当前位置: 代码迷 >> Web前端 >> ext tab范例
  详细解决方案

ext tab范例

热度:143   发布时间:2012-11-22 00:16:41.0
ext tab实例

ext tab实例

?

//装载tab
var nlSemantics = {completeLoad:0}
Ext.onReady(function (){
	var items = [{//装载 新增TabPanel
	 	   id : "tabPanel1",
	 	   title:'新建模板SQL',
	 	   contentEl : 'nlNewSemantics'
	},{//装载 完整TabPanel
		 id : "tabPanel2",
		 title: "模板SQL",
		 contentEl : 'nlCompleteSemantics'
	}];
	
	//生成tab
	var tab = Ext.createWidget('tabpanel',{
		renderTo  : 'nlSemanticsPanel',
		activeTab : 0,
		width: document.body.offsetWidth-20,
		height: 800,
		plain: true,
		enableTabScroll:true,
		defaults:{autoScroll:true},
		//closable:false
		items:items
	});
	var tabchangeShow = function(){
		if(nlSemantics.completeLoad == 0){
			nlSemantics.completeLoad = 1;
			showSemanticsList(2,'complete_list');
		}
	}
	tab.addListener("tabchange",tabchangeShow);
	//装载新增TabPanel 新增button
	var addButtonItem = new Ext.create('Ext.Button',{
		text:'新建模板',
		renderTo:'new_button',
		handler : function(){showItemEditPage(1)}//showAddSemanticsPanel
	});
	//新增记录列表
	showSemanticsList(1,'new_list');
	//装载完整TabPanel 完整记录列表
})
?
  相关解决方案