newstartgirls
newstartgirls

Reputation: 281

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

I have created a gridpanel with column 'name' and 'sex' For the toolbar, I have created a combobox of sex. After I select the value of combos 'sex' , the column 'sex' of all rows in the gridpanel will be update to the selected value. How can I update the column of all rows? Thanks.

Upvotes: 1

Views: 2862

Answers (1)

Dev
Dev

Reputation: 3932

This is one approach :

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

Please have a look at 'set' method Ext.data.Model

Upvotes: 1

Related Questions