Xtemplate shows blank item instead of not showing it with sencha touch 2.1
What i want to do is to show the item of a list of data conditionally,that
is , when the item meet the condition,it will show,otherwise,it will not
show(not means show a blank item). My data to be showed is like this :
[
{'label':'one','isvisible':'1','value':'one'},
{'label':'two','isvisible':'1','value':''},
{'label':'three','isvisible':'0','value':'three'},
{'label':'four','isvisible':'0','value':''}
]
And my list is like below:
xtype : 'list',
disableSelection : true,
itemTpl : [
'<tpl if="visible == 1 && value !=\'\' ">',
'{label}{value}',
'</tpl>'
]
But when the list showed,i have got some blank rows if the item meets the
condition(the property 'visible' is 1 or the property 'value' is empty).
At first,i used '<tpl for="." ' ,I followed this link: link but my list of
data have no root node,so i used the itemtpl above.
I do not want to modify the strcuture of my list of data,so how can i do ?
No comments:
Post a Comment