Ext.BLANK_IMAGE_URL = '../res/lib/ext2/resources/images/default/s.gif'; /* 主窗口 */ Ext.onReady(function() { /* 设置提示消息的显示方式 */ Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = 'side'; Ext.Tree.init(); /* 设置窗口 layout */ var north, south, west, center; /*================== 菜单 区 ==================*/ //================== 关闭按钮 // 测试 function showResult(btn){ //Ext.example.msg('Button Click', 'You clicked the {0} button', btn); window.alert(btn); }; var actBtnClose = new Ext.Action({ text: '登出', handler: function(){ Ext.MessageBox.confirm('提示', '<span vlign="middle">确定登出本系统平台 ?</span>', showResult); }, iconCls: 'bmenu-close' }); //================== 菜单 var menu = new Ext.menu.Menu({ id: 'mainMenu', items: [ { text: '更换用户' //checkHandler: onItemCheck }, { text: '更换角色' //checkHandler: onItemCheck }, '-', { text: '退出' //checkHandler: onItemCheck }] }) var tb = new Ext.Toolbar(); tb.render('north-div'); tb.add('-','-',{ text:'系统菜单', iconCls: 'bmenu', // <-- icon menu: menu // assign menu by instance }, actBtnClose); /*================== Top 区 ==================*/ north = new Ext.BoxComponent({ // raw region:'north', el: 'north-div', titlebar: true, border:false, margins:'3 0 -12 5', autoLoad: {url: 'template/Header.html', scripts: true, scope: this}, height:40}); /*================== 状态区 ==================*/ south = new Ext.Panel({ // raw region:'south', contentEl: 'south-div', titlebar: true, split:true, height: 80, minSize: 80, maxSize: 200, collapsible: true, title:'信息提示', margins:'0 0 0 0'}); /*================== 导航区 ==================*/ west = new Ext.Panel({ region:'west', id:'west-panel', el:'west-div', titlebar: true, title:'功能导航', autoScroll:true, split:true, width: 200, minSize: 175, maxSize: 400, collapsible: true, margins:'0 0 0 5', layout:'accordion', layoutConfig:{animate:false} }) /*================== 内容区 ==================*/ center = new Ext.Panel({region:'center', //margins:'5 5 5 0', cls:'empty', contentEl: 'center-div', bodyStyle:'background:#f1f1f1', autoScroll:true, html:'<br/><br/><empty center panel>' }) /*================== 内容组合 ==================*/ var viewport = new Ext.Viewport({ layout:'border', items:[north, west, center] }) }) |