PDA

View Full Version : A better way to remove the column sort icon?



hyponym
10 Aug 2010, 3:55 AM
When sortable is disabled on all grid columns, I noticed the first column retains the sort-asc icon.

I call this on afterrender to delete the image



var imgs = Ext.query('.x-grid3-sort-icon');
Ext.each(imgs, function(item,index) {
Ext.removeNode(item);
});


Aside from preselecting the grid node to speed up the query, is there a better way to do this?

I thought perhaps setting the background-image attribute on the class...

mankz
10 Aug 2010, 3:59 AM
Do you still want sorting to be enabled? Otherwise there's a setting on the grid that disables sorting for all columns.

hyponym
10 Aug 2010, 4:02 AM
Yes i do

mankz
10 Aug 2010, 4:03 AM
Then set a 'cls' property, e.g. 'myClass' and add a CSS rule:



.myClass .x-grid3-sort-icon
{
display:none;
}

hyponym
10 Aug 2010, 4:13 AM
that's much better thanks!