How to Change the getRowClass function on an ExtJS GridPanel viewconfig After Render
I have an Ext.grid.Panel with a function that returns a custom class that is used to color code rows in the grid by overriding the getRowClass function. This works great, but I would like to give the user the option to change the criteria by which the grid is colored. The below example, I am coloring by the "severity" attribute, but I would like to change that to "status", for example. Is there a way I can dynamically change the getRowClass function,or maybe the entire viewconfig on the grid, and have the grid recolor, after the grid has already been rendered?
</span>
Code:
alarmsGrid = Ext.create('Ext.grid.Panel',
{ title: 'Netcool Alarms',
id: 'Netcool Alarms',
columnLines: true,
store: alarms_store,
loadMask: true,
stripeRows: true,
viewConfig: {
getRowClass: function(record, rowIndex, rowParams, store){
return record.get('severity').toLowerCase();
}
},
Note:
Code:
alarmsGrid.viewConfig.getRowClass = function(record, rowIndex, rowParams, store){ return record.get('status').toLowerCase(); }
seems to have no effect