PDA

View Full Version : Need to change the color of cell in grid or Tree Panel at runtime



srisaravananwt
3 Nov 2012, 10:09 AM
Hi,

I have tried with following script to change the color of a cell in TreePanel and it is not working. Please help me to resolve this.

var position = {};
position['row'] = 3;
position['column'] = 5;
cell=marketPanel.getView().getCellByPosition(position,true);
cell.setStyle('background:#EEB4B4');[Here marketPanel is Ext.tree.Panel]

I will include these statements in a function and will call at run time.
Please let me know whether this will work.

Note: I don't want to use render.

vietits
3 Nov 2012, 3:37 PM
Try to fix your code as below:


var position = {};
position['row'] = 3;
position['column'] = 5;
cell = marketPanel.getView().getCellByPosition(position,true);
// cell.setStyle('background:#EEB4B4');
Ext.fly(cell).setStyle('background', '#EEB4B4');

srisaravananwt
4 Nov 2012, 11:25 PM
Thankd. It is working.