1. #591
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Quote Originally Posted by vmorale4 View Post
    [B]Basic conditional logic
    Using the tpl tag and the if operator you can provide conditional checks for deciding whether or not to render specific parts of the template. Note that there is no else operator — if needed, you should use two opposite if statements. Use of multiple conditions is supported via the && and || operators. Properly-encoded attributes are required as seen in the following example:
    It would be more correct to say that the if condition can be any javascript expression (including all operators).
    Sidenote: the " character needs to be written as " to avoid conflicts with detecting the end of the expression.

  2. #592
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Quote Originally Posted by Condor View Post
    Sidenote: the " character needs to be written as " to avoid conflicts with detecting the end of the expression.
    I missed your point here. Can you post sample text for the docs to demonstrate?

  3. #593
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    The current XTemplate doc already contains an encoded example:
    Code:
    <tpl if="age &gt; 1">',  // <-- Note that the > is encoded
    But the only character that should actually be encoded is the double quote: " (&quot;)

    Encoding & (&amp;), < (&lt;) or > (&gt;) is optional.

  4. #594
    Sencha User vmorale4's Avatar
    Join Date
    Mar 2007
    Location
    Chicago, IL
    Posts
    189
    Vote Rating
    0
    vmorale4 is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    It would be more correct to say that the if condition can be any javascript expression (including all operators).
    Sidenote: the " character needs to be written as &quot; to avoid conflicts with detecting the end of the expression.
    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. :
    PHP Code:
         '<tpl if="age + 1 &gt; 1 && name='Zachary'">',  // <-- Note that the > is encoded 
    Quote Originally Posted by Condor View Post
    The current XTemplate doc already contains an encoded example:
    Code:
    <tpl if="age &gt; 1">',  // <-- Note that the > is encoded
    But the only character that should actually be encoded is the double quote: " (&quot

    Encoding & (&amp, < (&lt or > (&gt is optional.
    AHA! So that's why I didn't have to encode the &&, good to know..

  5. #595
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    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.
    Attached Images

  6. #596
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    I patched up the 2nd image from the last comment.
    Attached Images

  7. #597
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    I think you missed the point on the &quot; encoding.

    You need to encode " if it is part of the condition, e.g.
    Code:
    <tpl if="name == &quot;Jack&quot;">Hello</tpl>

  8. #598
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Quote Originally Posted by Condor View Post
    The current XTemplate doc already contains an encoded example:
    Code:
    <tpl if="age &gt; 1">',  // <-- Note that the > is encoded
    But the only character that should actually be encoded is the double quote: " (&quot

    Encoding & (&amp, < (&lt or > (&gt is optional.
    Quote Originally Posted by Condor View Post
    I think you missed the point on the &quot; encoding.

    You need to encode " if it is part of the condition, e.g.
    Code:
    <tpl if="name == &quot;Jack&quot;">Hello</tpl>
    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

  9. #599
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    OK, the following examples are valid:

    Code:
    <tpl if="age &gt; 1 &amp;&amp; age &lt; 10">Child</tpl>
    <tpl if="age >= 10 && age < 18">Teenager</tpl>
    <tpl if="name == &quot;Jack&quot;">Hello</tpl>
    and this one isn't:
    Code:
    <tpl if="name == "Jack"">Hello</tpl>

  10. #600
    Ext JS Premium Member
    Join Date
    Feb 2008
    Location
    France, Paris
    Posts
    38
    Vote Rating
    0
    aurelien is on a distinguished road

      0  

    Default 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])...

Thread Participants: 182

  1. JeffHowden (3 Posts)
  2. Animal (64 Posts)
  3. tryanDLS (10 Posts)
  4. christocracy (1 Post)
  5. jarrod (2 Posts)
  6. jay@moduscreate.com (21 Posts)
  7. JTM (1 Post)
  8. vtswingkid (1 Post)
  9. young_matthewd (3 Posts)
  10. sjivan (1 Post)
  11. yogurtearl (1 Post)
  12. Condor (34 Posts)
  13. mdissel (2 Posts)
  14. steve.neill (4 Posts)
  15. mikegiddens (3 Posts)
  16. rmesser (1 Post)
  17. jweber (1 Post)
  18. aconran (8 Posts)
  19. vmorale4 (13 Posts)
  20. tof (4 Posts)
  21. stever (1 Post)
  22. berend (3 Posts)
  23. Jul (16 Posts)
  24. bone (2 Posts)
  25. timb (1 Post)
  26. punkrider (2 Posts)
  27. dolittle (4 Posts)
  28. papasi (1 Post)
  29. kimu (1 Post)
  30. willydee (2 Posts)
  31. dotnetCarpenter (1 Post)
  32. steven (3 Posts)
  33. DeyV (1 Post)
  34. cdomigan (1 Post)
  35. JorisA (2 Posts)
  36. MaxT (3 Posts)
  37. jsakalos (2 Posts)
  38. tellioglu (2 Posts)
  39. architect (1 Post)
  40. ksachdeva (1 Post)
  41. PFM (1 Post)
  42. evant (4 Posts)
  43. thesilentman (4 Posts)
  44. para (2 Posts)
  45. sj137 (6 Posts)
  46. J.C. Bize (3 Posts)
  47. Jonno70 (1 Post)
  48. splintor (9 Posts)
  49. mribbons (1 Post)
  50. danh2000 (1 Post)
  51. loeppky (2 Posts)
  52. mdm-adph (3 Posts)
  53. NBRed5 (1 Post)
  54. meej (1 Post)
  55. tobiu (1 Post)
  56. patspam (1 Post)
  57. gimbles (2 Posts)
  58. jan1234 (2 Posts)
  59. Ytorres (1 Post)
  60. aparajita (4 Posts)
  61. carol.ext (2 Posts)
  62. end-user (3 Posts)
  63. nicora (1 Post)
  64. devnull (4 Posts)
  65. AdamDawes (1 Post)
  66. mjlecomte (92 Posts)
  67. BlackICE1979 (1 Post)
  68. vincentc (1 Post)
  69. rednix (3 Posts)
  70. hansellh (1 Post)
  71. TaterSalad (1 Post)
  72. aptana_michelle (1 Post)
  73. Trixor (3 Posts)
  74. Iveco (1 Post)
  75. mscdex (4 Posts)
  76. watrboy00 (8 Posts)
  77. pic_Nick (1 Post)
  78. tohagan (1 Post)
  79. gimler (1 Post)
  80. smcguire36 (1 Post)
  81. ziesemer (2 Posts)
  82. balou (1 Post)
  83. yarmy (1 Post)
  84. jerrybrown5 (1 Post)
  85. abent (1 Post)
  86. lvanderree (4 Posts)
  87. Greenosity (1 Post)
  88. tjcrowder (18 Posts)
  89. treffer (2 Posts)
  90. SeaSharp (3 Posts)
  91. dhurlburtusa (1 Post)
  92. neshaug (2 Posts)
  93. tony_k (1 Post)
  94. Jim McCabe (1 Post)
  95. dyndan (1 Post)
  96. Hemlock (1 Post)
  97. runnersixty (1 Post)
  98. stoober (1 Post)
  99. battisti (1 Post)
  100. slobo (1 Post)
  101. plan-r (2 Posts)
  102. joeaudette (1 Post)
  103. paradawks (1 Post)
  104. saJoshua (7 Posts)
  105. t34 (6 Posts)
  106. markpele (1 Post)
  107. Gordon76 (1 Post)
  108. mankz (3 Posts)
  109. cblin (1 Post)
  110. jasonbronson (3 Posts)
  111. stebru (1 Post)
  112. Enes (1 Post)
  113. jburnhams (1 Post)
  114. david.james (1 Post)
  115. krystian (1 Post)
  116. erlando (1 Post)
  117. asteidle (1 Post)
  118. iamnoah (1 Post)
  119. molasses (1 Post)
  120. jonn (3 Posts)
  121. jhurst (1 Post)
  122. Starfall (14 Posts)
  123. creusois (1 Post)
  124. silvereen (1 Post)
  125. vilivili (2 Posts)
  126. jezmck (1 Post)
  127. nbourdeau (1 Post)
  128. YarivYaari (1 Post)
  129. luv2hike (1 Post)
  130. mrileyaz (1 Post)
  131. jmcneese (1 Post)
  132. treqx (1 Post)
  133. willdudziak (1 Post)
  134. NOSLOW (3 Posts)
  135. tomcheng76 (2 Posts)
  136. jove4015 (1 Post)
  137. xpurpur (1 Post)
  138. mknopp (1 Post)
  139. aurelien (2 Posts)
  140. nctag (5 Posts)
  141. pbuyle (1 Post)
  142. keckeroo (2 Posts)
  143. vcastel (1 Post)
  144. switch (1 Post)
  145. dcesarnascimento (1 Post)
  146. mirko (1 Post)
  147. mdkalman (1 Post)
  148. nb (1 Post)
  149. makana (2 Posts)
  150. fins (1 Post)
  151. NoahK17 (1 Post)
  152. Answerfor (1 Post)
  153. russn (1 Post)
  154. accilies (1 Post)
  155. SamuraiJack1 (1 Post)
  156. Eric24 (2 Posts)
  157. Funcracker (5 Posts)
  158. oxyum (1 Post)
  159. SoreGums (1 Post)
  160. Berni (1 Post)
  161. photomo (1 Post)
  162. nicktak (1 Post)
  163. don_luiz (2 Posts)
  164. wwarby (7 Posts)
  165. hAmpzter (1 Post)
  166. masuran (1 Post)
  167. ben_dog (3 Posts)
  168. thboileau (4 Posts)
  169. kds.chris (1 Post)
  170. salewski (1 Post)
  171. Mjollnir26 (1 Post)
  172. mikamikaze (1 Post)
  173. dreas (2 Posts)
  174. mschwartz (1 Post)
  175. jililv (2 Posts)
  176. TinKim (1 Post)
  177. zgrose (1 Post)
  178. martinjrb (1 Post)
  179. flinz (2 Posts)
  180. PierceSD (1 Post)
  181. dlgoodchild (1 Post)
  182. brian.moeskau (12 Posts)

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar