PDA

View Full Version : Modifying rows on Editor Grid problem



Grisco
14 Jun 2010, 8:39 AM
Hi,

I need to change the style of a row as the grid is initialising. I read the post in the FAQ which worked for me,

http://www.extjs.com/learn/Ext_FAQ_Grid#How_To_modify_the_styling_of_a_row

except that when the grid is initialised, the width of all columns has been changed (set to 0).

Apart from that all is working fine. I assume it's something to do with the class being returned in the getRowClass function:



var grid = new Ext.grid.EditorGridPanel({
renderTo: 'gridContainer',
width: 1300,
height: 700,
columns: columnModel,
store: remoteJsonStore,
loadMask: true,
stripeRows: true,
viewConfig: {
forceFit: true
}, viewConfig: {

getRowClass: function(row, index) {
var cls = '';
var data = row.data;
if (data.shading == true) {
cls = 'x-grid3-row-shaded';// which is 'background-color: red !important;'
} else {
cls = 'x-grid3-row';
}
return cls;
}
}
});
Does anyone know how to prevent this?

Many thanks

Grisco
14 Jun 2010, 11:58 PM
20951

Please find attached screenshot of grid.