extjs问题

bobo_包子 2010-05-06 09:38:19
Ext.grid.GridPanel第一次显示,第二次就出错

var konwlegeClassGrid =new Ext.grid.GridPanel
这里定义了一个gridpanel

listeners: {
click: function(n) {
......
var panelId=....//自己定义的
if (!Ext.isDefined(Ext.getCmp(panelId))) {
var problemPanel = new Ext.Panel({//定义新面板
id: panelId,
title: n.attributes.text,
closable: true
});
//这里定义每个页面的内容
//debugger;
var text = n.attributes.text;
if (text == "分类管理") {//分类管理
problemPanel.add(konwlegeClassGrid );//这里把上面gridpanel加上
problemPanel.doLayout();
konwlegeClassStore.load({ params: { start: 0, limit: 25} });
}
Ext.getCmp("centerTP").add(problemPanel);
Ext.getCmp("centerTP").setActiveTab(problemPanel);
}
else {
Ext.getCmp("centerTP").setActiveTab(panelId);
}

第一次左侧的树节点时 第一次可以打开,关闭后再打开就出错
...全文
87 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangbiao198911 2010-05-20
  • 打赏
  • 举报
回复
没遇到过,帮顶
lilin8905 2010-05-18
  • 打赏
  • 举报
回复
没用过,帮顶
assiwe 2010-05-18
  • 打赏
  • 举报
回复
估计是id问题,if(this.getComponent(panelId))判断一下试试
sohighthesky 2010-05-18
  • 打赏
  • 举报
回复
jf就jf吧,下次把extjs问题放到javascript或者ajax版块,
bobo_包子 2010-05-18
  • 打赏
  • 举报
回复
近来个人接分
bobo_包子 2010-05-06
  • 打赏
  • 举报
回复

csdn月来越让人失望额
bobo_包子 2010-05-06
  • 打赏
  • 举报
回复
if (text == "分类管理") {//分类管理
var newpp = new Ext.grid.GridPanel(konwlegeClassGrid);
problemPanel.add(newpp);
//problemPanel.add(konwlegeClassGrid );//这里把上面gridpanel加上
problemPanel.doLayout();
konwlegeClassStore.load({ params: { start: 0, limit: 25} });
}

如果是这样的话,也是第二次打开就能显示了,但是 bbar: new Ext.PagingToolbar 就不能显示了

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧