extjs 更新网格中所有行中的列的值

extjs update the value of a column in all rows in grid

本文关键字:更新 网格 extjs      更新时间:2023-09-26

我创建了一个网格面板,其中列有"name"和" 对于工具栏,我创建了一个性别组合框。选择组合"性别"的值后,网格面板中所有行的"性别"列将更新为所选值。如何更新所有行的列?谢谢。

这是一种方法:

var store = Ext.getStore('YourGridStore'),
value = yourCombo.getValue();
store.each(function(record){
      record.set('sex',value);
}
//refresh your grid view

请看一下"设置"方法Ext.data.Model