nickponico
31 Jan 2011, 7:31 AM
Hi, I'm learning sencha touch framework, and I'm trying to have a list View with an "even-odd" css style: changing style between even rows and odd rows.
I've tried with itemTpl conditional like this
Ext.Panel({
...
items: [{
height:500,
xtype:"list",
store: listStore,
itemTpl: '<tpl for="."><tpl if="xindex%2==0"><div class="odd"></tpl><tpl if="xindex%2==1"><div class="even"></tpl> ...</div></tpl>',
}]
});
This code works but, it changes the internal div that is only an inner div of the list view: viewed effect is not correct, because not all the row has the style (like background-color).
How can I manage styles in the list views? Even - Odd, or selection style?
Is there anyone who can helps me?
Thanks
nick
I've tried with itemTpl conditional like this
Ext.Panel({
...
items: [{
height:500,
xtype:"list",
store: listStore,
itemTpl: '<tpl for="."><tpl if="xindex%2==0"><div class="odd"></tpl><tpl if="xindex%2==1"><div class="even"></tpl> ...</div></tpl>',
}]
});
This code works but, it changes the internal div that is only an inner div of the list view: viewed effect is not correct, because not all the row has the style (like background-color).
How can I manage styles in the list views? Even - Odd, or selection style?
Is there anyone who can helps me?
Thanks
nick