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. OleDb 读取 excel

    //定义变量 _Application ExcelApp; Workbooks wbsMyBooks; _Workbook wbMyBook; Worksheets wssMysheets; _Wor ...

  2. Java基础知识强化95:Calendar类之Calendar类的add()和set()方法

    1. Calendar的add()和set()方法: public void add(int field,int amount):根据给定的日历字段和对应的时间,来对当前的日历进行操作 public ...

  3. Linux内核启动分析

    张超<Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 我的代码可见https://www.shiyanlo ...

  4. python的运算符

    #coding=utf-8#"+"两个对象相加#两个数字相加a=7+8print a #两个字符串相加b="GOOD"+"JOB"print ...

  5. IE7append新的元素自动补充完整路径

    在IE7下,进行append操作时,会把像<img />的src补成完整路径.对于上传到临时目录的图片,提交到后台要进行路径判断的情形要十分注意.

  6. (转)SQL流程控制语句学习(一):变量及控制语句种类

    1.局部变量 用户自己定义的,称局部变量,以@标识. 作用范围:定义局部变量的批处理.存储过程.触发器和语句块 局部变量的定义: declare @局部变量名 数据类型 注意:变量的类型不能是text ...

  7. 自定义圆形imageview

    import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapShader ...

  8. Jason 分享吴霁虹教授的产品模型

    产品的出现都是为了解决市场上存在的某一个”疼点“或一系列的”疼点“而出现. 疼点:是一个亟需待解决的问题,对应有相应的市场,会寻找相应的解决方案.比如:用户的小孩——>因为缺钱,所以担心小孩无法 ...

  9. CocoaPods报错:The dependency `xxx` is not used in any concrete target

    官网是这样给推荐的: 在创建Podfile的时候,用这种格式使用, platform :ios, '8.0' use_frameworks! target 'MyApp' do pod 'AFNetw ...

  10. QT5-控件-QDial(表盘控件)

    #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QDial> class ...