Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13230 closed defect (fixed)

dojox.mvc.repeat get error when parsed in template

Reported by: zhangyp Owned by: rahul
Priority: high Milestone: 1.7
Component: DojoX MVC Version: 1.7.0b1
Keywords: Cc: Ed Chatelain
Blocked By: Blocking:

Description

When we use ref: '${this.index}' for data binding in dojox.mvc.repeat, '${this.index}' will be treated as variable in Django template by dijit._TemplatedMixin in _stringRepl: function(tmpl) and will cause the function to throw error.

Is there anyway to prevent this being replaced when dojox.mvc.repeat is used in template string?

Attachments (2)

templated.zip (3.4 KB) - added by zhangyp 8 years ago.
13230-mvc.patch (19.5 KB) - added by Ed Chatelain 8 years ago.

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by zhangyp

Attachment: templated.zip added

comment:1 Changed 8 years ago by Adam Peller

Cc: Ed Chatelain added; Edward_Chatelain@… akolkar@… removed
Component: DojoxDojoX MVC
Owner: changed from Adam Peller to rahul

comment:2 Changed 8 years ago by Chris Mitchell

Priority: highnormal
severity: criticalnormal

comment:3 Changed 8 years ago by rahul

One of the options may be to avoid getting pigeonholed into a specific syntax that may step on someone else's toes. We are looking into making the syntax customizable (per repeat instance even).

comment:4 Changed 8 years ago by Ed Chatelain

I will add a patch which adds support for an optional attribute named exprchar. So for example is exprchar is set to # on a dojox.mvc.Repeat, then the substitution would look for something like this #{this.index} instead of ${this.index}. I also added a testcase for this problem.

There was one other minor update to dojox.mvc._Container.js to remove a js warning for eval(exp, pThis) as reported in ticket 13317.

Changed 8 years ago by Ed Chatelain

Attachment: 13230-mvc.patch added

comment:5 Changed 8 years ago by Chris Mitchell

Resolution: fixed
Status: newclosed

(In [25662]) fixes #13230 dojox.mvc.repeat get error when parsed in template \!strict

comment:6 Changed 8 years ago by Chris Mitchell

(In [25663]) refs #13230 dojox.mvc.repeat get error when parsed in template \!strict

comment:7 Changed 8 years ago by ben hockey

(In [25677]) added missing dep from r25662 refs #13230 !strict

comment:8 Changed 8 years ago by bill

Milestone: tbd1.7
Note: See TracTickets for help on using tickets.