-
26 Feb 2009 10:41 PM #591
-
27 Feb 2009 4:21 AM #592
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
27 Feb 2009 5:34 AM #593Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
The current XTemplate doc already contains an encoded example:
But the only character that should actually be encoded is the double quote: " (")Code:<tpl if="age > 1">', // <-- Note that the > is encoded
Encoding & (&), < (<) or > (>) is optional.
-
27 Feb 2009 6:40 AM #594
Got it... By all operators this means we can use arithmetic operators right?.
I like your version (the if condition can be any javascript expression (including all operators))
I would just perhaps change the example to make the above statement a little bit more obvious, i.e. :
AHA! So that's why I didn't have to encode the &&, good to know..PHP Code:'<tpl if="age + 1 > 1 && name='Zachary'">', // <-- Note that the > is encoded
-
27 Feb 2009 6:44 AM #595
Ok, here's an update, voice any concerns. Note that both ways are shown. Encoding the operator is shown in the example above the conditional section (image 1). Encoding the closing double quote along with && is shown in the example of second image, along with revised text.
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
27 Feb 2009 6:59 AM #596
I patched up the 2nd image from the last comment.
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
27 Feb 2009 7:12 AM #597Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
I think you missed the point on the " encoding.
You need to encode " if it is part of the condition, e.g.
Code:<tpl if="name == "Jack"">Hello</tpl>
-
27 Feb 2009 7:59 AM #598
Yes, I miss the point still. Your prior post has confused me. I haven't changed the docs.
Would it be appropriate to say the only character that has to be encoded is double quote (or whatever the opening symbol for the "if" string is:
Code:<tpl if="name == ...<encode any double quotes here>... ">Hello</tpl> // must encode any double quotes inside if expression
Code:<tpl if='name == ...<encode any single quotes here>... '>Hello</tpl> // must encode any single quotes inside if expression
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
27 Feb 2009 8:03 AM #599Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
OK, the following examples are valid:
and this one isn't:Code:<tpl if="age > 1 && age < 10">Child</tpl> <tpl if="age >= 10 && age < 18">Teenager</tpl> <tpl if="name == "Jack"">Hello</tpl>
Code:<tpl if="name == "Jack"">Hello</tpl>
-
3 Mar 2009 5:46 AM #600
Function.createDelegate doc error
Function.createDelegate doc error
in the createDelegate method into the Function class it seems that :
...Example: this.myFunction.createDelegate(this, [arg1, arg2])...
should be replaced by
...Example: this.myFunction.createDelegate(obj, [arg1, arg2])...



Reply With Quote