一定要将全局定义名称在function外面,不然其它地方就访问不了呀。搞到我一头雾水!
附上代码:
var panel;
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif)
function showAddPanel()
{
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (!panel)
{
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
panel = new Ext.Window(
{
id:'panel',
el : 'panel',
layout : 'fit',
width : 600,
height : 500,
closeAction : 'hide',
plain : true,
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
items : new Ext.TabPanel(
{
region : 'center',
border : false,
activeTab : 0,
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
items : [
{
title : '客户信息',
autoScroll : true,
items : [afm]
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
},
{
title : '合作项目',
autoScroll : true
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
},
{
title : '相关报价',
autoScroll : true
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
},
{
title : '相关订单',
autoScroll : true
}]
}),
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
buttons : [
{
text : '保存'
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
},
{
text : '重置'
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
},
{
text : '关闭',
![](http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
handler : function()
{
panel.hide();
}
}]
});
}
![](http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif)
panel.show(this);
}
posted on 2007-12-05 16:47
阿门119 阅读(2814)
评论(2) 编辑 收藏 引用 网摘 所属分类:
Ext