Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
添加记录之前,ExtJs网格未正确显示_Extjs_Grid_Collapse_Extjs3 - Fatal编程技术网

添加记录之前,ExtJs网格未正确显示

添加记录之前,ExtJs网格未正确显示,extjs,grid,collapse,extjs3,Extjs,Grid,Collapse,Extjs3,正如topic所说,在添加记录之前,网格看起来异常,但在添加记录之后,网格看起来又正常了。代码如下: grid = new Ext.grid.GridPanel({ id: 'grid', store: grid_store, width: 890, height: 270, readOnly: false, autoExpandColumn: 'message_name', c

正如topic所说,在添加记录之前,网格看起来异常,但在添加记录之后,网格看起来又正常了。代码如下:

   grid = new Ext.grid.GridPanel({
        id: 'grid',
        store: grid_store,
        width: 890,
        height: 270,
        readOnly: false,
        autoExpandColumn: 'message_name',
        columns: [{
            id: 'message_name',
            header: "Message Name",
            width: 330,
            menuDisabled: true,
            align: "left",
            sortable: true,
            dataIndex: 'message_name'
        }, {
            id: 'message_value',
            header: "Value",
            width: 560,
            menuDisabled: true,
            align: "left",
            sortable: true,
            dataIndex: 'message_value'
        }],
        listeners: {
            rowclick: function (grid, rowIndex, e) {
                gridClicked(record.get('order'));
            }
        }
    })

更新:已修复,但不确定原因;要修复:网格位于选项卡中,当选项卡更改时,获取网格视图,然后刷新它:

   var gridRefresh = function(){
       if (grid && grid.getView) {
          grid.getView().refresh(true); 
        }
    }
    var tabpanel = new Ext.TabPanel({
            id: "tabpanel",
            plain: true,
            width: 950,
            height: 410,
            defaults: { bodyStyle: 'background-color:#DFDFDF;' },
            activeTab: 0,
            frame: true,
            items: tabItems,
            listeners: {
                "tabchange": function (tabpanel, tab) {
                    if (tab.id == "grid_tab") { //Document Tab
                        grid.gridRefresh();
                    }
                }
            }
        });

宽度:890,高度:270,,
中删除双逗号,以便于更好地理解。已删除,但问题仍然存在。如果您可以创建,也可以使用哪个版本的框架?