网格未作为惩罚项加载。

Posted

技术标签:

【中文标题】网格未作为惩罚项加载。【英文标题】:Grid is not loading as a item of penal. 【发布时间】:2016-07-01 11:16:48 【问题描述】:

我正在尝试通过 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】:

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

【讨论】:

以上是关于网格未作为惩罚项加载。的主要内容,如果未能解决你的问题,请参考以下文章

Assimp 和 D3D 模型加载:网格未在 D3D 中显示

登录重定向后 Office 2016 加载项中的“Word 对象未定义”

Visual Studio 2022 未加载依赖项

自定义演示未加载到 Magnolia CMS

添加 Azure AD 服务依赖项时租户未加载

在未加载重复项的多个 python 脚本之间共享变量(来自文件的数据)