Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ah, basic mistake, this is what you've got in your code :: </p> <pre><code>&lt;tpl if="val == 0"&gt; </code></pre> <p>And this is what it should be instead :::</p> <pre><code>&lt;tpl if="val === 0"&gt; </code></pre> <p>** Notice the three "equal to" signs that you need to add between the two values you're actually comparing. So if you normally wrote </p> <pre><code>x=y </code></pre> <p>Then in a template that would be </p> <pre><code>x==y // (you basically add an extra equal) </code></pre> <p>So a conditional statement like </p> <pre><code>x==y //when you're checking if the values are equal </code></pre> <p>Becomes </p> <pre><code>x===y </code></pre> <p>EDIT :: Adding the Coding for the entire row to be filled with the background color assigned </p> <p>NOTE :: Please make a separate XTemplate object, and not inline tpl code. That will allow you to harness the full potential of the XTemplate, including member functions which are incredibly cool ! </p> <p><strong>Trial 1 ::</strong> </p> <p><em>tpl Code to be added for background color</em> </p> <pre><code> '&lt;li class="{[this.listClasses(xindex,xcount)]}"&gt;', '&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; {nameOfMeeting}&lt;/b&gt;', '&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;Start Time : {start} &amp;nbsp; &amp;nbsp;&amp;nbsp; || &amp;nbsp; &amp;nbsp;&amp;nbsp; End Time : {end}', '&lt;/li&gt;', { listClasses : function(position, size){ var classes = []; if (position%2===0) {classes.push("even")} else {classes.push("odd")}; if (position === 1) {classes.push("first")} else {classes.push("last")}; return classes.join(" "); } } </code></pre> <p>//Note : I've added in the helper functions that I'm using to change the background color of the class. My tpl, basically uses alternate color on every list line. So if the first line is green, the second is yellow, the third is green, the fourth is yellow, and so on. </p> <p><em>Associated CSS to be added (for the listClasses selected in the li tag)</em></p> <pre><code>#meetingsList li.odd { background-color: #ebdde2; } #meetingsList li.even { background-color: #fdeef4; } #meetingsList li.odd { border-bottom: 1px solid #999; } #meetingsList li.even { border-bottom-style: none; } </code></pre> <p><strong>EDIT Trial 2 :: New CSS to be added</strong> </p> <p>CSS </p> <pre><code>.testview .x-dataview-item { border-bottom : 1px solid #cccbcb; } .testview .x-item-selected { background-color: #006bb6; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #50b7ff), color-stop(2%, #0080da), color-stop(100%, #005692) ); background-image: -webkit-linear-gradient(#50b7ff, #0080da 2%, #005692); background-image: linear-gradient(#50b7ff, #0080da 2%, #005692); color: #fff;; text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; border-color: #103656; } </code></pre> <p>To add the CSS into Code, add the following to the list object :: </p> <pre><code>{ xtype : 'list' . . . . cls : 'testview' } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload