ext--tablepanel

2245 단어 Extext
tabpanel.html Ext.onReady(function(){ var tabPanel = new Ext.TabPanel( { activeTab:0,// Tab width:document.body.clientWidth, height:document.body.clientHeight, closable : true, autoDestroy:true, items:[ {title:" 1",html:"<b> 1</b>",bodyStyle:"padding:10px"},// 。 {title:" 2",autoLoad:{url:"../index.jsp"}},// {title:" 3",contentEl:"div1"}, {title:" 4",html:"<b> 4</b>"}, {title:" 5",html:"<b> 5</b>"} ], renderTo:"tab", defaults:{autoScroll:true}, enableTabScroll:true,// border:true,// 。 frame:true } ); Ext.get("btn1").on("click",function(){ var activeTab = tabPanel.getActiveTab(); tabPanel.items.each(function(item){ alert(item); if (item.closable && item != activeTab){ tabPanel.remove(item); } }); }); Ext.get("btn2").on("click",function(){ tabPanel.items.each(function(item){ if (item.closable){ tabPanel.remove(item); } }); }); var i = 6; // Ext.get("btn3").on("click",function(){ var tabpanel = new Ext.TabPanel( { title:"TabPanel" + i, html:"TabPanel" + i } ); tabPanel.add(tabpanel); // tabPanel.setActiveTab(tabpanel); // i++; }); // Ext.get("btn4").on("click",function(){ var currentTab = tabPanel.getActiveTab(); tabPanel.remove(currentTab); // }); });

좋은 웹페이지 즐겨찾기