PDA

View Full Version : Remove alternate row color and adding back groud color to the grid



bevara.siva
18 Jun 2014, 4:08 AM
Hi,

We are using Ext Js 4.2.2.
We have 2 grids in a page. For 1 grid we dont need the alternate row color and need to set the back ground color to the complete grid.

How can I remove "x-grid-row-alt" class for the grid and apply the back ground color.

Please help.

Regards,
SivaPrasad.B

scottmartin
18 Jun 2014, 8:29 AM
Have a look at:


viewConfig: {
stripeRows: false
},



Here is a good reference for color in grid:
http://skirtlesden.com/articles/styling-extjs-grid-cells

bevara.siva
19 Jun 2014, 5:33 AM
Hi scottmartin.

Thank you for the response.
With "stripeRows: false" alternate row colors are not showing.

For Back ground color we are applying the body style property.
Now we wanted to remove the Mouse hover (removing x-grid-row-over) color and row selection color (x-grid-row-selected).

Please help.

Regards,
SivaPrasad.B

scottmartin
19 Jun 2014, 5:59 AM
You can use the following code to not show hover or allow selection:



Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: store,

trackMouseOver: false, // remove hover

columns : [
{ header : 'Name', dataIndex : 'name' },
{ header : 'Email', dataIndex : 'email', flex : 1 },
{ header : 'Change', dataIndex : 'change' }
],
height: 200,
width: 500,

renderTo: Ext.getBody(),

// no selection
listeners : {
beforeselect : function() {
return false;
}
}
});