<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%$sitename%></title>
<%*加載的Extjs 資源文件 -- 開始*%>
<link rel="stylesheet" type="text/css" href="<%$extjs_res%>" />
<script type="text/javascript" src="<%$extjs_adapter%>"></script>
<script type="text/javascript" src="<%$extjs_laction%>"></script>
<%*加載的Extjs 資源文件 -- 結束*%>
<%*執行塊的JS區域 -- 開始*%>
<script type="text/javascript">
//具體開發 -- BJExtreme類
BJExtreme= function(){} ;
BJExtreme.prototype.getAuthor = function(){
return '許消寒' ;
}
BJExtreme.prototype.getVersion = function(){
return '2008年08月13日 17:00' ;
}
BJExtreme.prototype.getController = function(){
return 'index.php' ;
}
BJExtreme.prototype.buildLinkStr = function(ctl,act){
if (ctl == undefined)
return BJExtreme.prototype.getController() ;
if (act == undefined)
act = null ;
return BJExtreme.prototype.getController() + '?ctl=' + ctl + '&act=' + act ;
}
BJExtreme.prototype.showWindow = function(title1,width1,height1,html1){
if (this.win == undefined){
this.win = new Ext.Window({
title: title1,
width: width1 ,
height: height1 ,
html: html1
});
}
else {
this.win.close();
this.win = new Ext.Window({
title: title1,
width: width1 ,
height: height1 ,
html: html1
});
}
this.win.show();
}
/*對出現的UI組件單獨封裝*/
BJExtreme.prototype.ui = function(){} ;
BJExtreme.prototype.ui.mainTopic = {
title: 'Beijing Extreme 后臺管理', region: 'north' ,
html: '<embed src="<%$prj_dir%>/swf/top_title.swf" quality="high" type="application/x-shockwave-flash" width="450" height="50"></embed>'
};
/*左側菜單項操作 -- 開始*/
//定義初始話狀態時的菜單條對象
BJExtreme.prototype.ui.menuBar = {
xtype: 'treepanel' ,
title: '菜單',region: 'west',width: 200 ,collapsible: true ,
loader: null , root: null ,rootVisible: true , listeners: null
};
//旅游相關
BJExtreme.prototype.ui.menuBar.Traveling = {
text: '旅游' ,
leaf: false , // 這個設為false 則顯示文件夾圖標 , true 則顯示單項圖標
children: null
};
BJExtreme.prototype.ui.menuBar.Traveling.children = [
{text: '北京',leaf: true ,ctl: 'Peking',act: ''},
{text: '西藏' ,leaf: true ,ctl: 'Tibet' ,act: ''},
{text: '泰國' ,leaf: true},
{text: '香格里拉',leaf: true,ctl:'Shangrila',act: ''}
];
//藏醫相關
BJExtreme.prototype.ui.menuBar.Mibetdoctor = {
text: '藏醫' ,
leaf: false ,
children: null
};
BJExtreme.prototype.ui.menuBar.Mibetdoctor.children = [
{text: '藏醫歷史',leaf: true},
{text: '藏醫理論' ,leaf: true},
{text: '診斷' ,leaf: true},
{text: '病癥' ,leaf: true},
{text: '治療',leaf: true}
];
//潛水
BJExtreme.prototype.ui.menuBar.ping = {
text: '潛水' ,
leaf: false ,
children: null
};
//登山
BJExtreme.prototype.ui.menuBar.Mountain = {
text: '登山' ,
leaf: false ,
children: null
};
//攀巖
BJExtreme.prototype.ui.menuBar.Rockclimbe = {
text: '攀巖' ,
leaf: false ,
children: null
};
//徒步
BJExtreme.prototype.ui.menuBar.Onfoot = {
text: '徒步' ,
leaf: false ,
children: null
};
//摩托車
BJExtreme.prototype.ui.menuBar.Motorcycle = {
text: '摩托車' ,
leaf: false ,
children: null
};
//項目中集成的模塊
BJExtreme.prototype.ui.menuBar.ModuleInProject = {
text: '項目中集成的模塊' ,
leaf: false ,
children: null
};
BJExtreme.prototype.ui.menuBar.ModuleInProject.children = [
{
text: '互動提示條',leaf: true,ctl: 'ExtjsStudy',act: 'linkTips',
//這個運行的優先級高于下面的那個通用的監聽控制器
listeners:{click: function (n){window.open(BJExtreme.prototype.buildLinkStr(n.attributes.ctl,n.attributes.act));return false ;}}
}
];
//初始化 菜單項元素 信息 -- 這個必須在 -- 當前菜單是使用異步樹組件生成的 , 以后可以添加其他不同的實現
BJExtreme.prototype.ui.menuBar.loader = new Ext.tree.TreeLoader();
BJExtreme.prototype.ui.menuBar.root = new Ext.tree.AsyncTreeNode({
expanded: true ,
children: [
BJExtreme.prototype.ui.menuBar.Traveling ,
BJExtreme.prototype.ui.menuBar.Mibetdoctor ,
BJExtreme.prototype.ui.menuBar.ping ,
BJExtreme.prototype.ui.menuBar.Mountain ,
BJExtreme.prototype.ui.menuBar.Rockclimbe ,
BJExtreme.prototype.ui.menuBar.Onfoot ,
BJExtreme.prototype.ui.menuBar.Motorcycle ,
BJExtreme.prototype.ui.menuBar.ModuleInProject
]
});
//定義一個簡單的響應事件
BJExtreme.prototype.ui.menuBar.listeners = {
click: function (n) //n.attributes 可以獲得AsyncTreeNode的children中的對象
{
if (n.attributes.leaf == true) //葉選項
{
//n.attributes.text n.attributes.leaf
var ctlStr = BJExtreme.prototype.buildLinkStr(n.attributes.ctl,n.attributes.act);
myextreme.showWindow('當前控制器',400,300,ctlStr) ;
}
else //包含子菜單
{
//not to do
}
}
};
//菜單選項結束
//主內容面板
BJExtreme.prototype.ui.contentPane = {
id: "main_content", xtype: "tabpanel" , region: 'center' ,items: [{title: '主內容面板'}]
};
//狀態條
BJExtreme.prototype.ui.statusBar = {
xtype: "tabpanel" , region: 'south' ,items: [{title: '狀態條'}]
};
BJExtreme.prototype.buildMainPane = function(BJExtremeObj){
//Ext.Viewport 用來將對象渲染到頁面中的body塊中,會自動改變,每個頁面僅限一個
this.mainPane = new Ext.Viewport({
enableTabScroll: true ,
layout: 'border', //設為fit則不能顯示復合面板
items: [
BJExtremeObj.ui.mainTopic,
BJExtremeObj.ui.menuBar ,
BJExtremeObj.ui.contentPane ,
BJExtremeObj.ui.statusBar
]
}) ;
}
var myextreme = new BJExtreme() ;
Ext.onReady(
function(){
//Ext.MessageBox.alert('BJExtreme Version',myextreme.getVersion());
//Ext.MessageBox.alert('BJExtreme Version',myextreme.buildLinkStr('t','b'));
myextreme.buildMainPane(myextreme) ;
}
);
</script>
<%*執行塊的JS區域 -- 結束*%>
</head>
<body>
<!-- //頁面中子導航菜單 -->
</body>
</html>
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com