Ext.onReady(function() { var i = 0; var tabCenter = new Ext.TabPanel( { region : 'center', margins : '0 0 0 0', id : 'tab_view', activeTab : 0, //tabWidth : 135, resizeTabs: true, minTabWidth: 120, enableTabScroll : true, defaults : { xtype : 'panel', closable : true }, items : [ { iconCls : 'smt-welcome', title : '桌面', id : 'btnAlert', closable : false, html : '模块' } ], bbar : [ { text : '添加选项', handler : function() { var id = 'tab' + i; tabCenter.add( { title : '子面版' + i++, id : id, //html: '<iframe name="centerF" frameborder="0" width="100%" height="100%" src="grid.jsp"/>' html: '<iframe name="centerF" frameborder="0" width="100%" height="100%" src="http://www.baidu.com"/>' //autoLoad:'grid.jsp' }); tabCenter.setActiveTab(id); } } ] }); var naveAccordion = new Ext.Panel( { title : '导航栏', layout : 'accordion', region : 'west', iconCls : 'menu_panel', width : 180, height : 400, collapsible : true, margins : '0 0 0 0', animCollapse : false, animFloat : false, split : true, items : [ { title : 'Panel 1', iconCls : 'smt-administrator', html : '<p>Panel content!</p>' }, { title : 'Panel 2', iconCls : 'smt-administrator', html : '<p>Panel content!</p>' }, { title : 'Panel 3', iconCls : 'smt-administrator', html : '<p>Panel content!</p>' } ] }); var viewport = new Ext.Viewport( { layout : 'border', title : 'Border Layout', layout : 'border', items : [ { region : 'north', margins : '0 0 0 0', border : false, height : 25, bbar : [ { iconCls : 'smt-administrator', text : 'admin' }, '-', { iconCls : 'smt-systemTime', id : 'theCurrentTime' }, '->', { text : '退出', iconCls : 'smt-exit', handler : function() { window.location.href = '<%=path%>/admin/to_login'; } } ] }, naveAccordion, tabCenter ] }); });