I'd like to change the tdCls of a grid column dynamically - hopefully that's possible.

I've set up a jsFiddle here that contains a grid. The first column initially has a tdCls of 'bold-column', which just bolds the text in that column. When you click 'Change Column tdCls' the first column is assigned to the variable column but I'm not sure what to do at that point to change the column's tdCls to 'red-column'.

Any help would be greatly appreciated, thanks!

有帮助吗?

解决方案

You just need to set the property on your own and refresh the grid view:

column.tdCls = 'red-column';
grid.getView().refresh();

Here is an updated fiddle.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top