📄 tabs-adv.js
字号:
/*
* Ext JS Library 2.0 RC 1
* Copyright(c) 2006-2007, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.BLANK_IMAGE_URL = './ajax_tree/s.gif';
Ext.onReady(
function(){
// shorthand
var Tree = Ext.tree;
var tree = new Tree.TreePanel({
el:'tree-div',
autoScroll:true,
animate:true,
enableDD:true,
containerScroll: true,
loader: new Tree.TreeLoader({
dataUrl:'./menu.php'
})
});
// set the root node
var root = new Tree.AsyncTreeNode({
text: userroot,
draggable:true,
id:'0'
});
tree.setRootNode(root);
// render the tree
tree.render();
root.expand();
var tabs = new Ext.TabPanel({
renderTo:'tabs',
//layout:'anchor',
//region:'north',
//resizeTabs:true, // turn on tab resizing
minTabWidth: 115,
tabWidth:135,
enableTabScroll:true,
height:497,
//defaults: {autoScroll:false},
plugins: new Ext.ux.TabCloseMenu(),
loadClass : function(title1,cls,href){
href='<iframe src=\''+href+'\' width=\'100%\' height=\'100%\' onload=\'closeit()\' SCROLLING=\'auto\'></iframe>';
var id = 'docs_' + cls;
var tab = this.getComponent(id);
if(tab){
this.setActiveTab(tab);
}else{
build();
if(cls!="default"){
var p = this.add({
id:id,
title:title1,
iconCls:'tabs',
html:href,
closable:true
});
}
else{
var p = this.add({
id:id,
title:title1,
iconCls:'tabs',
html:href,
closable:false
});
}
this.setActiveTab(p);
}
}
});
// tab generation code
tabs.loadClass('用户中心','default','down.php');
tree.on('click', function(node, e){
if(node.attributes.leaf=="true"){
e.stopEvent();
tabs.loadClass(node.attributes.title, node.id,node.attributes.href);
}
else{
e.stopEvent();
}
});
});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -