dimanche 18 mai 2014

How to style a grid after refreshing it?

Hi,

I'm using the following code to style a grid based on its content :



Code:



viewConfig: {
getRowClass: function(record, rowIndex, rowParams, store){
switch(record.get('status')){
case 'PENDING':
return 'row-yellow';
case 'REJECTED':
return 'row-red';
}
}
},

The problem is that I can't call this method when I refresh the grid. I tried the following but it doesn't work.

Code:



var store = grid.getStore();
var i = 0, record = '';
while(record = store.getAt(i)){
grid.viewConfig.getRowClass(record,i,{},store);
i++;
}

How can I fix this?

Thanks


Aucun commentaire:

Enregistrer un commentaire