PDA

View Full Version : [CLOSED] Changing datarow background color after switching from v1.x to v2.x



tMp
Jan 24, 2014, 10:18 AM
Hi

With v1.x I was changing the color of my datatable rows according to some content of specific records via javascript on <PrepareToolbar Fn="prepare" /> of a command column. However with v2.x this code doesn't work anymore. I haven't found out yet what changed.

Any ideas?

v1.x javascript code not working anymore with 2.x:

grid.getView().getRow(rowIndex).style.backgroundCo lor = 'Yellow';

Thank you!

Daniil
Jan 24, 2014, 1:08 PM
Hi @tMp,

A direct substitution could be:

var row = Ext.fly(App.GridPanel1.getView().getNode(0));

row.select("td").setStyle({
"background-color": "yellow";
})

Though, if possible, I would recommend to use a GetRowClass to apply styles for rows.
http://examples2.ext.net/#/GridPanel/Miscellaneous/Marking_Records/

tMp
Jan 24, 2014, 4:03 PM
@Daniil

I have now idea anymore how I got to use it that way. Switched asap to getRowClass and now it is working perfectly.

Thank you and have a great weekend!

Daniil
Jan 24, 2014, 4:30 PM
Thank you! Have a nice weekend too!