extjs grid color

change extjs grid’s row color:

1. write a css file: eg. under image/icon.css(attention of the red text)

.x-grid3-record-red .x-grid-cell{
color: #FF0000 ;
}

2. link to use it in jsp(after ext-all.css but before any js):

<link rel=”stylesheet” type=”text/css” href=”css/icon.css”>

3. add below js code into grid:

Ext.create(‘Ext.grid.Panel’, {

viewConfig: {
forceFit: true,
getRowClass: function(record,rowIndex,rowParams,store){
if(record.data.estartflag==’N’){
return ‘x-grid3-record-red’;
}else {
return ”;
}
}
},

good luck!

This entry was posted in Computer, Java. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s