我有一个带有列的可编辑网格面板,当我按下 applyToAll 按钮时,我想将列中的每个单独的值更改为相同的值。似乎没有任何 api 调用使我能够获取列中的所有值,甚至是网格面板中的所有值。
//Model that defines my column named fileName
var colModel = new Ext.grid.ColumnModel([{
header:'File Name',
dataIndex:'fileName'
}
]);
// Editable grid panel:
var myGrid = new Ext.grid.EditorGridPanel({
store: store,
colModel: colModel,
clicksToEdit: 1,
autoWidth: true,
autoHeight: true
});
// Button that changes all the column names
var applyToAll = new Ext.Button({
text: "Apply to All",
handler: function(){
var record = myGrid.getSelectionModel().getSelected();
//Change the values of the column here somehow.
}
});
//Form which holds everything
var gridForm = new Ext.FormPanel({
id: 'mainForm',
frame: true,
items: [{
columnWidth: 0.6,
layout: 'fit',
items: [myGrid],
buttons: [applyToAll]
});
单击 applyToAll 按钮时,如何更改列中的所有值?