PDA

View Full Version : Hide icon in action column for particular row



sunil_vakotar
25 Oct 2010, 5:39 AM
Hi,

i used action column in my grid.
i have put 3 icon now for each row..

but now the requirement is I display icon in action columns as per the JSON response for that grid.

Please provide some workaround ASAP.

Thanks

Condor
25 Oct 2010, 5:46 AM
Write a getClass method for the action item that returns 'x-hide-display' when the icon should not be visible.

tharahan
20 Feb 2013, 10:44 AM
Try something like


menuDisabled: true,
sortable: false,
xtype: 'actioncolumn',
flex : 2,
items: [{
icon : 'resources/images/tradeCancel.png',
tooltip: 'Remove',
handler: function(grid, rowIndex, colIndex) {
var store = Ext.StoreManager.get('TradeAllocations');
var rec = store.getAt(rowIndex);
if(rec.data.tradeId == "") {
rowEditing.cancelEdit();
store.removeAt(rowIndex);
}

},
getClass: function(v, meta, rec) {
if(rec.data.tradeId != "") {
return 'x-hide-display';
}
}
}
]
}