Ich schrieb meine Ajax in der Komponente init und ich bekomme alle erforderlichen Daten in this.store
. Aber ich bekomme keinen Bereich des Speichers im Raster, wo ich definiert habe. Da ich die Klammer von Ajax Success schließe, bin ich nicht. Was ist der richtige Weg? mein Code:So erhalten Sie den Umfang des Geschäfts im Raster
initComponent: function() {
this.fields = [];
this.columns = [];
this.data = [];
this.store = [];
Ext.Ajax.request({
url: 'XML/1Cohart.xml',
scope: this,
timeout: global_constants.TIMEOUT,
method: "GET",
disableCaching: true,
failure: function(response) {
utils.showOKErrorMsg(sdisMsg.ajaxRequestFailed);
},
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++) {
//debugger;
var fieldName = this.fields[i].name
this.record[i] = columnData.getAttribute(fieldName);
}
this.data.push(this.record);
}, this);
this.store = new Ext.data.ArrayStore({
fields : this.fields
});
this.store.loadData(this.data); // Getting correct data in this.store
},
});
In derselben init Komponente in Ost-Panel i Gitter definiert. für welche Spalte kommt, aber Speicher wird nicht bekommen.
Grid Code ist
{
xtype: 'panel',
region: "east",
header: true,
collapsible: true,
autoScroll: true,
//columnWidth: 0.5,
width: "30%",
hideBorders: true,
split: true,
items: [{
xtype: 'panel',
title: "Search Result",
height:500,
items: [{
xtype: 'grid',
itemid: 'ABC_GRID',
store : this.store,
autoHeight: true,
sm: new Ext.grid.CheckboxSelectionModel({singleSelect:true}),
frame: true,
columns : this.columns,
}]
}]
'initComponent' wird auf welcher Komponente aufgerufen? Wo ist Ihr Grid-Code definiert? –
Grid ist auch in der init-Komponente. Ich verliere den Bereich von 'this.store' nur in Ajax-Erfolg. – David