PDA

View Full Version : Highlight some rows in a Grid



harman
13 Mar 2012, 12:52 AM
Hi all,

I need to highlight a few specific rows of a grid with different colour.
How do i do that?
I tried using

grid.getView().focusRow(0)
on the load event of the store.
Also i do not want to select it ; just highlighting it will do my job.

Note that i am populating the store from a remote location using ajax call.

Thanks for the help in advance

chramer
13 Mar 2012, 1:27 AM
i hope this helps : http://jsfiddle.net/serju/Msj3Y/


viewConfig: {
getRowClass: function(record) {
return 'rowstyle';
}
}

harman
13 Mar 2012, 3:03 AM
Thanks for the quick reply.
That worked for me.
A few changes that i found


viewConfig:{
getRowClass:function(record){if(!record)return'';if(record.data.id == user.id)return'bg-yellow';} }

for CSS



.bg-yellow > td { background:#fffec7 !important; }


courtsey smatric

Hope someone will find this helpful.