在用EXTJS 的panel
for (a = 0; a < strspot.length; a++) { // if (findpanel == "undefined") {
var findpanel = Ext.getCmp(strspot[a]);
alert(findpanel);
if (findpanel != "undefined") {
Ext.create('Ext.Panel', { height: 100,
width: 100,
id: strspot[a],
title: strspot[a],
renderTo: 'Div1',
closable: true,
frame: true,
componentCls: 'floatpl'//排序样式
})
}
// alert("created")
// }
// else {
// alert("已经创建了"+strspot[a]);
// }
}
}strspot 是一个数组 存的是名称
我的界面上有个Tree ,strspot 就是tree上的节点名称
每单击一次节点添加一个panel
为了不重复添加 加上了一个判断
但我的结果如下图第一个是我第一次单击添加的panel
第二个是我第二次单击后出现的、、、、
求解~~
JavaScript界面Ext JS
for (a = 0; a < strspot.length; a++) { // if (findpanel == "undefined") {
var findpanel = Ext.getCmp(strspot[a]);
alert(findpanel);
if (findpanel != "undefined") {
Ext.create('Ext.Panel', { height: 100,
width: 100,
id: strspot[a],
title: strspot[a],
renderTo: 'Div1',
closable: true,
frame: true,
componentCls: 'floatpl'//排序样式
})
}
// alert("created")
// }
// else {
// alert("已经创建了"+strspot[a]);
// }
}
}strspot 是一个数组 存的是名称
我的界面上有个Tree ,strspot 就是tree上的节点名称
每单击一次节点添加一个panel
为了不重复添加 加上了一个判断
但我的结果如下图第一个是我第一次单击添加的panel
第二个是我第二次单击后出现的、、、、
求解~~
JavaScript界面Ext JS
我想根据数组strspot 添加多个的panel
for就是用来循环strspot的
我做的界面是 多窗口的数据显示 而我是打算用panel当作数据显示的容器
改为
if (findpanel!=undefined)
或者改成:if (typeof(findpanel) == "undefined")
或者改成:if (typeof(findpanel) == "undefined")
typeof(findpanel) 一直都是undefined 而 第二次单击后findpanel为object