[img]/upload/attachment/74770/fb37140d-6739-3262-b888-37a26d9afbf1.gif[/img]
[img]/upload/attachment/74772/7bad695d-216a-3c70-9f23-e7c1822e0ad8.gif[/img]
[img]/upload/attachment/74774/395474b5-4648-3d79-94ed-5694e2e7b9d3.gif[/img]
我新建了一个Ext.grid.GridPanel,然后把它加入到tabpanel中,开始点击左边的导航菜单时候正常显示,当我关闭后,再次点击菜单是,显示不正常,我参考了这个问题http://www.iteye.com/topic/214588,但是还是不行,以下是部分代码,也不知道这样直接在tabpanel里添加GridPanel是否合适,我是个新手,请问大家有什么好的经验没有?谢谢!
Ext.grid.GridPanel的定义:
var grid = new Ext.grid.GridPanel({
title:'商家列表',
store: store,
trackMouseOver:false,
disableSelection:true,
loadMask: true,
closable:true,
closeAction: 'hide',
// grid columns
columns:[{
//id: 'id', // id assigned so we can apply custom css (e.g. .x-grid-col-topic b { color:#333 })
header: "商家名称",
dataIndex: 'mingcheng',
width: 420
},{
header: "地址",
dataIndex: 'dizhi',
width: 100
}],
// paging bar on the bottom
bbar: pagingBar
});
tabpanel的定义(包含在Ext.Viewport的布局中):
{
region: 'center',
xtype: 'tabpanel',
id:'tabs',
items: [{
title: '用户首页',
contentEl:'welcome'
}
这是菜单响应:
{
text: '商家列表',
id:'oa_sjlb',
leaf: true,
listeners: {
click: function(n) {
Ext.getCmp('tabs').add(grid);
store.load({params:{start:0, limit:2}});
grid.show();
}
}