添加记录之前,ExtJs网格未正确显示
正如topic所说,在添加记录之前,网格看起来异常,但在添加记录之后,网格看起来又正常了。代码如下:添加记录之前,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
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,,
中删除双逗号,以便于更好地理解。已删除,但问题仍然存在。如果您可以创建,也可以使用哪个版本的框架?