Reset EditorGridPanel column values
I'm looking for way how to on button click reset all fields in EditorGridPanel in one column
There is a code of column
....
{
id: 'field开发者_StackOverflow中文版_id',
header: "Amount [ton/ha]",
sortable: true,
dataIndex: 'amountId',
width: 150,
summaryType: 'sum',
summaryRenderer: function(v){
return v +' [ton/ha]';
},
editor: new Ext.form.NumberField({
allowBlank: false,
allowNegative: false,
style: 'text-align:left'
}),
groupName: 'Amount'
},
.....
So far this is going to be editable, what you can see from the code and it works perfect, just want to add possibility to reset all values, is it posible at all?
Store
and even Record
have methods for rejecting and commiting changes. I haven't used them but I believe it would be like this:
Ext.getCmp('myGrid').getStore().getAt(0).rejectChanges();
and for all rows in the store:
Ext.getCmp('myGrid').getStore().rejectChanges();
精彩评论