ExtJS 4.1 ActionColumn Dynamic CSSClass

来源:互联网 发布:什么微单最好 一款知 编辑:程序博客网 时间:2024/05/18 00:39

In ExtJS 4.1 there is a function for ActionColumn to dynamically change css class using user customized functiongetClass

One example is http://www.learnsomethings.com/2011/09/25/the-new-extjs4-xtype-actioncolumn-in-a-nutshell/

This one works in 4.0 but not in 4.1, the only problem is that when the new CSS Class is set using getClass, you have to call grid.refresh() function to explicitly tell the gridview to refresh.

This refresh will also refresh the row CSS Class, so the temporarily added "line-through" class in the example will be removed.

To make the "line-through" work, you need to put the logic into getRowClassfunction of viewConfig of that grid panel.

More details about the Grid View can be found here: http://docs.sencha.com/extjs/4.1.0/#!/api/Ext.grid.View

Grid View is NOT Grid Panel, but has been used by Grid Panel. All actions actually happens on View not the Panel itself.