网格没有作为一个惩罚项加载。

时间:2016-07-01 11:16:49

标签: ajax extjs extjs3

我正在尝试使用ajax调用将网格作为项目面板加载。我的网格没有加载。你能帮我么。这是我正在尝试,因为我没有在ext ajax调用中获得范围。

我的代码是

{
                xtype: 'panel',
                title: "Search Result",
                height:500,
                items: [
                        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) {
                                debugger;
                                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) {
                                 //debugger;
                                   //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);     
                                var grid = new Ext.grid.GridPanel({
                                        store: this.store,
                                        flex: 1,
                                        columns: this.columns,
                                        stripeRows: true,
                                        id: 'RID',
                                        autoHeight: true,
                                        //sm: new Ext.grid.Checkbo;xSelectionModel({singleSelect:true}),
                                        frame: true,
                                    }); 
                            }
                        })
                        ]

            }]

实际上我没有获得范围所以我放在这里。

1 个答案:

答案 0 :(得分:0)

DataGridView