Javascript 如何获取网格中的存储范围

Javascript 如何获取网格中的存储范围,javascript,extjs,extjs3,Javascript,Extjs,Extjs3,我在init组件中编写了我的Ajax,并在this.store中获得了所有需要的数据。 但我并没有在我定义的网格中得到存储范围。因为我正在接近Ajax成功的门槛,所以我没有。正确的方法是什么。 我的代码是: initComponent: function() { this.fields = []; this.columns = []; this.data = []; this.store = []; Ext.Ajax.request({

我在init组件中编写了我的Ajax,并在
this.store
中获得了所有需要的数据。 但我并没有在我定义的网格中得到存储范围。因为我正在接近Ajax成功的门槛,所以我没有。正确的方法是什么。 我的代码是:

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
                        },
                    });

this.store中加载数据后
获取网格并重新配置其存储

   Ext.ComponentQuery.query("#ABC_GRID")[0].reconfigure(this.store);
用于ExtJs 3

我们需要使用
Ext.getCmp()
作为
Ext.ComponentQuery.query
不受支持。需要将网格的
id
属性定义为
id:ABC\u grid

Ext.getCmp("ABC_GRID").reconfigure(this.store)

您可以调用grid.getview().getStore(),而不是调用This.store,您将获得要加载数据的网格存储。

initComponent
在哪个组件上调用?网格代码在哪里定义?网格也在init组件中。我正在失去这个
的作用域。仅在Ajax成功中存储
。那么我在哪里声明我的网格,我应该在存储中保留空白?很抱歉,我尝试了,但它不起作用。EXTJS 3中甚至没有debugger.Ext.ComponentQuery.query停止。请参阅我对EXTJS 3的更新回答。无需在网格声明中定义存储。
Ext.getCmp("ABC_GRID").reconfigure(this.store)