问题
I am try to delete row from a grid. For that I need to strike a row. I am using addCls but it is not supporting in extjs 3. What is the alternate way to do that.
{
xtype: 'button',
text: 'Delete',
handler : function(){
var cogrid = Ext.getCmp('HART_GRID');
var costore = cohartgrid.getStore();
var record = Ext.getCmp('HART_GRID').getSelectionModel().getSelected();
if (record) {
Ext.fly(row).addCls('row-deleted');// This line is throwing error.
}
if(record.data.Excl == "No"){
cohartstore.remove(record);
}
} }
回答1:
In ExtJS you can not use addCls
but what you can use is addClass
As per your code you need index of row
and then use
Ext.fly(row[i]).addClass('row-deleted');
来源:https://stackoverflow.com/questions/38156553/how-to-use-addcls-in-extjs-3-2