var load = function(){
/**
* 书籍资料目录
*/
var bookIT = new Ext.tree.TreeNode({
text:"IT",
leaf:true,
listeners:{
click:function(){
Ext.MessageBox.alert("提示","您点击了"+bookIT.text);
}
}
});
var bookNovel = new Ext.tree.TreeNode({
text:"小说",
leaf:true,
listeners:{
click:function(){
Ext.MessageBox.alert("提示","您点击了"+bookNovel.text);
}
}
});
var bookFinance = new Ext.tree.TreeNode({
text:"金融",
leaf:true,
listeners:{
click:function(){
Ext.MessageBox.alert("提示","您点击了"+bookFinance.text);
}
}
});
var bookRoot = new Ext.tree.TreeNode({
id:"root",
text:"树的根"
});
bookRoot.appendChild(bookIT);
bookRoot.appendChild(bookNovel);
bookRoot.appendChild(bookFinance);
var bookTree = new Ext.tree.TreePanel({
id:'book_tree',
title:'书籍资料',
root:bookRoot,
rootVisible:false,
xtype:'treepanel',
enableDD : true, //允许子节点拖动
bodyStyle:'background-color:#CCCCFF' //设置面板颜色
//titleCollapse:true //True表示为允许单击头部区域任何一个位置都可收缩面板(无效果)
//loader: new Ext.tree.TreeLoader({dataUrl:'treedata.js'}),
//width:200
});
var houseCooking = new Ext.tree.TreeNode({
text:"厨具",
leaf:true,
listeners:{
click:function(){
Ext.MessageBox.alert("提示","您点击了"+houseCooking.text);
}
}
});
/**
* 家居用品目录
*/
var houseTable = new Ext.tree.TreeNode({
text:"桌椅",
leaf:true,
listeners:{
click:function(){
Ext.MessageBox.alert("提示","您点击了"+houseTable.text);
}
}
});
var houseRoot = new Ext.tree.TreeNode({
id:"root",
text:"树的根"
});
houseRoot.appendChild(houseCooking);
houseRoot.appendChild(houseTable);
var houseTree = new Ext.tree.TreePanel({
id:'house_tree',
title:'家居用品',
root:houseRoot,
rootVisible:false,
xtype:'treepanel',
enableDD:true,
bodyStyle:'background-color:#CCCCFF' //设置面板颜色
//width:200,
});
/**
* 电子目录
*/
var electronComputer = new Ext.tree.TreeNode({
text:"电脑",
leaf:true,
listeners:{
click:function(){
Ext.MessageBox.alert("提示","您点击了"+electronComputer.text);
}
}
});
var electronRoot = new Ext.tree.TreeNode({
id:"root",
text:"树的根"
});
electronRoot.appendChild(electronComputer);
var electronTree = new Ext.tree.TreePanel({
id:'electron_tree',
title:'电子',
root:electronRoot,
xtype:'treepanel',
rootVisible:false,
enableDD:true,
bodyStyle:'background-color:#CCCCFF' //设置面板颜色
//width:200
});
/**
* 服装目录
*/
var clothesMan = new Ext.tree.TreeNode({
text:"男装",
leaf:true,
listeners:{
click:function(){
Ext.MessageBox.alert("提示","您点击了"+clothesMan.text);
}
}
});
var clothesGirl = new Ext.tree.TreeNode({
text:"女装",
leaf:true,
listeners:{
click:function(){
Ext.MessageBox.alert("提示","您点击了"+clothesGirl.text);
}
}
});
var clothesRoot = new Ext.tree.TreeNode({
id:"root",
text:"树的根"
});
clothesRoot.appendChild(clothesMan);
clothesRoot.appendChild(clothesGirl);
var clothesTree = new Ext.tree.TreePanel({
id:'clothes_tree',
root:clothesRoot,
rootVisible:false,
xtype:'treepanel',
enableDD:true,
title:'服装',
bodyStyle:'background-color:#CCCCFF' //设置面板颜色
//width:200
}); new Ext.Viewport({
layout: 'border',
items: [{
region: 'north',
//renderTo:'main_top',
//applyTo:'main_top',
contentEl:'main_top',
height:100,
//xtype:'tabpanel',
//title:"首页"
// autoHeight: true,//自动设置高度
border: false,
margins: '0 0 5 0'
}, {
region: 'west',
collapsible: true,//设置前面的展开、收拢效果的加减号
title: '分类',
//xtype: 'treepanel',//不能写这个,否则页面会乱
width: 200,
minSize: 100,
maxSize: 400,//设置左侧面板拉伸的最大宽度与最小宽度
collapsible: true,//允许展开和收缩
autoScroll: true,
split: true,//让用户可以动态地改变区域的大小
items: [bookTree,houseTree,electronTree,clothesTree],
//下面是ext漂亮的折叠功能
layout: 'accordion',
layoutConfig: {
titleCollapse: true, //默认为true,表示单击标题就可以收缩子面板,如果设置为false,则必须单击标题右边的图标来收缩面板。
collapseFirst : false, //当显示title bar时,是否总把收缩、展开按钮放在所有其他按钮的前面。默认值为true。
animate: true, //是否使用动画效果。
hideCollapseTool : false, //当collapsible=true且hideCollapseTool=true时,则隐藏控制收缩、伸展的那个按钮,为false时就显示它,默认值为false。
activeOnTop: false //默认是false,展开和收缩后子面板的位置不变。如果设置为true,就会随着展开和收缩变换位置。展开的面板总是在最顶层
}
}, {
region: 'center',
xtype: 'tabpanel',
contentEl:'main_right',
title:"物品"
}]
});
}//end load
Ext.onReady(load);

自己写的Ext树,Ext3.4,静态全部加载的更多相关文章

  1. IDEA中Springboot静态文件加载(热部署)

    Springboot项目静态文件加载 昨天写项目的时候碰到一个问题,就是静态文件css无法读取到项目中,我仔细思考了下,总结了下,可能有两个问题 1.页面未加载更新 这个可能性非常大,Chrome就是 ...

  2. 静态属性加载到jvm时候就存放在数据共享区,而不是等new后出现

    静态属性加载到jvm时候就存放在数据共享区,而不是等new后出现.他的生命周期是 jvm结束 才会消失,一般的方法属性是对象结束后 就会消失.

  3. Django项目静态文件加载失败问题

    在我们平时的开发过程中,为了方便调试程序,我们都是打开开发者模式,即Debug=True,当我们正式上线的时候肯定就需要把开发者模式关掉,用uwsgi部署上去以后,突然发现我们平时辛苦做的项目的静态文 ...

  4. Django 04 模板标签(if、for、url、with、autoeacape、模板继承于引用、静态文件加载)

    Django 04 模板标签(if.for.url.with.autoeacape.模板继承于引用.静态文件加载) 一.if.for.url.with.autoescape urlpatterns = ...

  5. 前后端分离 导致的 静态页面 加载 <script type="module" > 报CORS 跨域错误,提示 blocked by CORS policy

    1.前言 静态页面 加载 <script type="module" > 报CORS 跨域错误,提示Access to script at ftp:///xxx.js ...

  6. 关于web项目中静态资源加载不了的一些解决思路

    问题的产生: <!--springMVC前端控制器加载--> <servlet> <servlet-name>springmvc</servlet-name& ...

  7. 面试题--JAVA中静态块、静态变量加载顺序

    最后给大家一道面试题练练手,要求写出其结果(笔试) public class StaticTest { public static int k = 0; public static StaticTes ...

  8. SpringMvc静态资源加载出错

    使用mvc:resource配置 web.xml配置是rest风格的/ 服务器启动没问题 访问地址是报404 另外用了default-servlet的方法加载,服务器启动没错,jsp页面加载静态资源要 ...

  9. (转)面试题--JAVA中静态块、静态变量加载顺序详解

    public class Test { //1.第一步,准备加载类 public static void main(String[] args) { new Test(); //4.第四步,new一个 ...

  10. EXT中的iconCls 图标加载

    刚刚遇到了个奇怪的问题. 我用 在主页面用TAB autoLoad:{url:link, nocache: true, scripts:true} 加载页面Student.jsp, 郁闷,FF可以正常 ...

随机推荐

  1. 重叠I/O之事件通知

      在 Winsock 中,重叠 I/O(Overlapped I/O)模型能达到更佳的系统性能,高于select模型.异步选择和事件选择三种.重叠模型的基本设计原理便是让应用程序使 用一个重叠的数据 ...

  2. VNC-Server installation on CentOS 7

    参考资料: https://www.howtoforge.com/vnc-server-installation-on-centos-7 https://linux.cn/article-5335-1 ...

  3. C# 面向对象 , 抽象基类

    抽象基类 关键字,  abstract abstract class SSS { public void aaa() { } } 作为抽象基类, 只能在 继承关系 中 担任父类的角色,不能出现在其他地 ...

  4. 基于jQuery仿uploadify的HTML5图片上传控件jquery.html5uploader

    (function($){ var methods = { init:function(options){ return this.each(function(){ var $this = $(thi ...

  5. socket.io 中文手册 socket.io 中文文档

    socket.io 中文手册,socket.io 中文文档转载于:http://www.cnblogs.com/xiezhengcai/p/3956401.html 服务端 io.on('connec ...

  6. 使用VS2012的C++生成dll

    1,首先,通过File->New Project的方式新建一个工程,打开"New Project"对话框. 2,选择Visual C++语言下的 Win32->Win3 ...

  7. An attempt to attach an auto-named database for file

    在用VS自带的 .mdf读取(joint)时,报错: Server Error in '/' Application. An attempt to attach an auto-named datab ...

  8. JavaAppArguments.java程序的更改

       此程序模仿JvaAppArgyments.java编写,从命令行接受多个数字,求和之后输出结果.  设计思想:命令行参数都是字符串,可以考虑用 Integer.parseInt(args[]) ...

  9. MySQL单列索引和组合索引的区别介绍

    MySQL单列索引和组合索引的区别介绍 作者:佚名出处:IT专家网2010-11-22 13:05 MySQL单列索引是我们使用MySQL数据库中经常会见到的,MySQL单列索引和组合索引的区别可能有 ...

  10. 淘宝接口实现ip归属地查询

    <?php header('content-type:text/html;charset=utf-8'); /*获取当前ip归属地 调用淘宝接口 */ function get_ip_place ...