extjs - if condition not working in sencha touch -
i using sencha touch developing mobile application. in list, using css alter color of values greater 0 (to green) , lesser 0(to red). values less 1000 color changes values greater 1000 color not changing.. please help
my code
<div class="amt_txt"> <tpl if="amount >= 0"> <span class='drill'> <strong> <span class='dollartxt'> $ </span> {amount} </strong> </span> <tpl elseif="amount <=0"> <span class="ylddatacolor3"> <span class='dollartxt'> $ </span> {amount} </span> </tpl> </div>
i utilize function this:
new ext.xtemplate( '<div class="amt_txt">' + '<span class="classforbold{[this.classchooser(values)]}">' + // <<--- here phone call '<span class='dollartxt'>' + '$' + '</span>' + '{amount}' + '</span>' + '</div>', classchooser: function(values) { // <<--- here function var amount = value.amount, returnvalue; switch (amount) { case < 1000: returnvalue = ' drill'; // of import leading blank break; case < 0: returnvalue = ' ylddatacolor3'; break; default: returnvalue = ''; } homecoming returnvalue; } )
extjs sencha-touch smarty
No comments:
Post a Comment