自己写的Ext树,Ext3.4,静态全部加载

1 var load = function(){* 书籍资料目录var bookIT = new Ext.tree.TreeNode({ 6text:”IT”, 7leaf:true, 8 listeners:{ 9 click:function(){ 10Ext.MessageBox.alert(“提示”,”您点击了”+bookIT.text); 11 } 12 } 13 }); 14var bookNovel = new Ext.tree.TreeNode({ 15text:”小说”, 16leaf:true, 17 listeners:{ 18 click:function(){ 19Ext.MessageBox.alert(“提示”,”您点击了”+bookNovel.text); 20 } 21 } 22 }); 23var bookFinance = new Ext.tree.TreeNode({ 24text:”金融”, 25leaf:true, 26 listeners:{ 27 click:function(){ 28Ext.MessageBox.alert(“提示”,”您点击了”+bookFinance.text); 29 } 30 } 31 }); 32var bookRoot = new Ext.tree.TreeNode({ 33id:”root”, 34text:”树的根” 35 }); 36 bookRoot.appendChild(bookIT); 37 bookRoot.appendChild(bookNovel); 38 bookRoot.appendChild(bookFinance); 39var bookTree = new Ext.tree.TreePanel({ 40id:’book_tree’, 41title:’书籍资料’, 42 root:bookRoot, 43rootVisible:false, 44xtype:’treepanel’,bodyStyle:’background-color:#CCCCFF’ //设置面板颜色True表示为允许单击头部区域任何一个位置都可收缩面板(无效果) 48//loader: new Ext.tree.TreeLoader({dataUrl:’treedata.js’}), }); 51var houseCooking = new Ext.tree.TreeNode({ 52text:”厨具”, 53leaf:true, 54 listeners:{ 55 click:function(){ 56Ext.MessageBox.alert(“提示”,”您点击了”+houseCooking.text); 57 } 58 } 59 });* 家居用品目录var houseTable = new Ext.tree.TreeNode({ 64text:”桌椅”, 65leaf:true, 66 listeners:{ 67 click:function(){ 68Ext.MessageBox.alert(“提示”,”您点击了”+houseTable.text); 69 } 70 } 71 }); 72var houseRoot = new Ext.tree.TreeNode({ 73id:”root”, 74text:”树的根” 75 }); 76 houseRoot.appendChild(houseCooking); 77 houseRoot.appendChild(houseTable); 78var houseTree = new Ext.tree.TreePanel({ 79id:’house_tree’, 80title:’家居用品’, 81 root:houseRoot, 82rootVisible:false, 83xtype:’treepanel’, 84enableDD:true, 85bodyStyle:’background-color:#CCCCFF’ //设置面板颜色 });* 电子目录var electronComputer = new Ext.tree.TreeNode({ 92text:”电脑”, 93leaf:true, 94 listeners:{ 95 click:function(){ 96Ext.MessageBox.alert(“提示”,”您点击了”+electronComputer.text); 97 } 98 } 99 });100var electronRoot = new Ext.tree.TreeNode({101id:”root”,102text:”树的根”103 });104 electronRoot.appendChild(electronComputer);105var electronTree = new Ext.tree.TreePanel({106id:’electron_tree’,107title:’电子’,108 root:electronRoot,109xtype:’treepanel’,110rootVisible:false,111enableDD:true,112bodyStyle:’background-color:#CCCCFF’ //设置面板颜色 });* 服装目录var clothesMan = new Ext.tree.TreeNode({119text:”男装”,120leaf:true,121 listeners:{122 click:function(){123Ext.MessageBox.alert(“提示”,”您点击了”+clothesMan.text);124 }125 }126 });127var clothesGirl = new Ext.tree.TreeNode({128text:”女装”,129leaf:true,130 listeners:{131 click:function(){132Ext.MessageBox.alert(“提示”,”您点击了”+clothesGirl.text);133 }134 }135 });136var clothesRoot = new Ext.tree.TreeNode({137id:”root”,138text:”树的根”139 });140 clothesRoot.appendChild(clothesMan);141 clothesRoot.appendChild(clothesGirl);142var clothesTree = new Ext.tree.TreePanel({143id:’clothes_tree’,144 root:clothesRoot,145rootVisible:false,146xtype:’treepanel’,147enableDD:true,148title:’服装’,149bodyStyle:’background-color:#CCCCFF’ //设置面板颜色 }); Ext.Viewport({155layout: ‘border’,156 items: [{157region: ‘north’,158//renderTo:’main_top’,contentEl:’main_top’,161height:100,162//xtype:’tabpanel’,163//title:”首页”border: false,166margins: ‘0 0 5 0’167 }, {168region: ‘west’,title: ‘分类’,width: 200,173minSize: 100,collapsible: autoScroll: true,items: [bookTree,houseTree,electronTree,clothesTree],layout: ‘accordion’,181 layoutConfig: {collapseFirst : animate: hideCollapseTool : activeOnTop: }188 }, {189region: ‘center’,190xtype: ‘tabpanel’,191contentEl:’main_right’,192title:”物品”193 }]194 });Ext.onReady(load);,美国服务器,网站空间,虚拟主机接受失败,是我们不常听到或看到的一个命题,

自己写的Ext树,Ext3.4,静态全部加载

相关文章:

你感兴趣的文章:

标签云: