PDA

View Full Version : Grid alternate rows color issue



shrik327
10 Feb 2010, 3:18 AM
hi,
I have developed one grid.Using stripeRows am getting alternate row color for grid.
But , when I move up down rows using buttons. Complete grid gets same color.
How do I get again alternate row color ?

My code for moving rows in grid is as follows

var kssDisplayGrid = new Ext.grid.EditorGridPanel({
store: KSSstore,
cm: cm,
sm: sm,
id: 'grid_id',
layout:'fit',
sortable: false,
enableHdMenu:false,
stripeRows: false,
autoExpandColumn:true,

plugins: solutionColumn,
clicksToEdit:true,
border:false,
viewConfig: {
forceFit: true,
scrollOffset:0

},

height: 400


});

function moveSelectedRow(grid, direction) {
debugger
var record = grid.getSelectionModel().getSelected();
if (!record) {
return;
}
var index = grid.getStore().indexOf(record);
if (direction < 0){
index--;
if (index < 0) {
return;
}
} else {
index++;
if (index >= grid.getStore().getCount()) {
return;
}
}
grid.getStore().remove(record);
grid.getStore().insert(index, record);
grid.getSelectionModel().selectRow(index, true);

}