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

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() {
dockedItems: [{
dock: 'bottom',
xtype: 'toolbar',
items: [{
text: 'annulla'
xtype: 'spacer'
text: 'acquista'

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


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"

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.


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