我从xml获取列数据和存储,其中我有三列。 我想在点击按钮上对第1列进行分组。我的按钮放在第二列的标题上。再次当我点击按钮时它会崩溃。
success: function(response) {
var datas = response.responseXML;
Ext.each(datas.getElementsByTagName("HEADER"), function(header) {
this.buildField(header);
this.buildColumn(header);
}, this);
Ext.each(datas.getElementsByTagName("G"), function(columnData) {
//this.buildData(columnData);
this.fieldLength = this.fields.length;
this.record = [];
for (i = 0; i < this.fieldLength; i++) {
var fieldName = this.fields[i].name
this.record[i] = columnData.getAttribute(fieldName);
}
this.data.push(this.record);
}, this);
var store2 = new Ext.data.ArrayStore({
fields: this.fields,
});
store2.loadData(this.data);
}
网格代码是:
{
xtype: 'grid',
id: 'ABC_GRID',
autoHeight: 400,
store: store2,
sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
frame: true,
columns: this.columns,
stripeRows: true,
}
感谢您的帮助