开发者

Reset EditorGridPanel column values

开发者 https://www.devze.com 2023-03-08 09:56 出处:网络
I\'m looking for way how to on button click reset all fields in EditorGridPanel in one column There is a code of column

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();
0

精彩评论

暂无评论...
验证码 换一张
取 消