PDA

View Full Version : Changing the css property of certain cells ;)



freepopo
13 Oct 2009, 7:01 AM
Hi!

I would to change the render of some cells in my grid. I guess i have to use the "beforerender" property but i don't know exactly how to change the cell's css property in a function...

Actually i successfully implement a "beforeedit" function which check if the current user is allowed or not to change the value of the clicked cell (and lock the cell if he's not allowed). Perhaps it's quit the same way for changing the render of a cell but what propery i have to change ?..

Thank you very much for any help :)

MiamiCoder
13 Oct 2009, 12:16 PM
One way is to use a renderer (http://www.extjs.com/deploy/dev/docs/source/Column.html#cfg-Ext.grid.Column-renderer) function on the column. You get value, metaData, record, rowIndex, colIndex and store passed to the renderer function and can change metaData.css or metaData.attr.