PDA

View Full Version : x-item-selected class on list doen't work



wakatanka
15 Jul 2010, 8:05 AM
hi, i've a button that launch this function:


bigprice = function(pic) {
if (!this.popup2) {
this.popup2 = new Ext.Panel({
id: 'bigpanel2',
floating: true,
modal: true,
centered: true,
width: 600,
height: 700,
styleHtmlContent: true,
dock: 'bottom',
scroll: 'vertical',
items: [{
xtype: 'list',
tpl: [
'<tpl for="."><div class="linea">{text}</div></tpl>',
],
itemSelector: 'div.linea',
singleSelect: true,
width: 550,
height: 456,
indexBar: true,
//selectedCls: 'newclass',
listeners: {
// itemtap: lineaselezionata,
beforerender: function() {
popola2(pic);
},
},
}],
dockedItems: [{
dock: 'bottom',
xtype: 'toolbar',
items: [{
text: 'annulla'
},
{
xtype: 'spacer'
},
{
text: 'acquista'
}]
}]
});
}
this.popup2.show();
};


it makes appear a panel with a list inside, populed by an ajax request (popola2).
It work all fine, but when i click on an element of the list, it doesn't get the x-item-selected class, but only the
"pressed".

help...

wakatanka
16 Jul 2010, 1:22 AM
:(( No one can help me?

i can find any option in list documentation for selected item class, it seems that is "automatic"

taylon
16 Jul 2010, 4:14 AM
Not sure if this is what you want but take a look at Evant's example of getting a handle on the selected item.

http://www.sencha.com/forum/showthread.php?103802-Detailed-view-called-from-a-list-of-items

SvenWS
1 Sep 2010, 8:56 AM
You have to setup your own css classes. Just copy the original classes to your css file and if you want rename it to 'my-x-item-selected' and 'my-x-item-pressed' and set selectedCls and pressedCls to these classnames.

See also http://www.sencha.com/forum/showthread.php?108581