I was wondering, is it possible to state an if statement (short or not) inside the itemTpl configuration of a List in Sencha Touch.
//My Model
Ext.define('ListItem', {
extend: 'Ext.data.Model',
config: {
fields: ['number', 'someBoolean']
}
});
//The List
var MyList = Ext.create("Ext.List", {
itemTpl : "{number} <br />"+
//THIS LINE BELOW IS WHAT ITS ALL ABOUT
("{someBoolean}")? + "The boolean was true" : +"It was false" ,
store: oListStore,
});
This results in a List filled with items representing NaN on the screen.
Is there a way to program around this?
Take a look at Ext.XTemplate
Here’s an example
Hope this helps