ExtJs加载JSON格式树
2013-06-28 23:05
519 查看
var mytree_2=new Ext.tree.TreePanel({
//el:"container",//应用到的html元素id
animate:true,//以动画形式伸展,收缩子节点
//title:"Extjs静态树",
//collapsible:true,
rootVisible:true,//是否显示根节点
autoScroll:true,
autoHeight:true,
//height:'100%',
width:'100%',
lines:true,//节点之间连接的横竖线
//树加载器(TreeLoader)的目的是从URL延迟加载树节点Ext.tree.TreeNode的子节点。返回值必须是以树格式的javascript数组
loader: new Ext.tree.TreeLoader({
preloadChildren: true,//若为true,则loader在节点第一次访问时加载"children"的属性
clearOnLoad: false//(可选)默认为true。在读取数据前移除已存在的节点
}),
root: new Ext.tree.AsyncTreeNode({
text:'ExtJs',
id:'root',
expanded:true,
children:[Docs.classData]
}),
collapseFirst:false
});
treedata.js内容
var Docs = {};
Docs.classData={
"id":"root",
"iconCls":"icon-docs",
"text":"根节点",
"singleClickExpand":true,
"expanded":true,
"leaf":false,
"children":[{
"id":"id1",
"iconCls":"icon-pkg",
"text":"子节点一",
"qtip":"asdk",//需要使用 Ext.QuickTips.init();//开启提示功能
"singleClickExpand":true,
"expanded":true,
"leaf":true
},{
"id":"child2",
"iconCls":"icon-pkg",
"text":"子节点二",
"singleClickExpand":true,//单击节点是否展开
"expanded":true,
"leaf":false,
"children":[{
"id":"child21",
"iconCls":"icon-pkg",
"text":"子节点三",
"singleClickExpand":true,//单击节点是否展开
"expanded":true,
"leaf":true
}]
}]
};
//el:"container",//应用到的html元素id
animate:true,//以动画形式伸展,收缩子节点
//title:"Extjs静态树",
//collapsible:true,
rootVisible:true,//是否显示根节点
autoScroll:true,
autoHeight:true,
//height:'100%',
width:'100%',
lines:true,//节点之间连接的横竖线
//树加载器(TreeLoader)的目的是从URL延迟加载树节点Ext.tree.TreeNode的子节点。返回值必须是以树格式的javascript数组
loader: new Ext.tree.TreeLoader({
preloadChildren: true,//若为true,则loader在节点第一次访问时加载"children"的属性
clearOnLoad: false//(可选)默认为true。在读取数据前移除已存在的节点
}),
root: new Ext.tree.AsyncTreeNode({
text:'ExtJs',
id:'root',
expanded:true,
children:[Docs.classData]
}),
collapseFirst:false
});
treedata.js内容
var Docs = {};
Docs.classData={
"id":"root",
"iconCls":"icon-docs",
"text":"根节点",
"singleClickExpand":true,
"expanded":true,
"leaf":false,
"children":[{
"id":"id1",
"iconCls":"icon-pkg",
"text":"子节点一",
"qtip":"asdk",//需要使用 Ext.QuickTips.init();//开启提示功能
"singleClickExpand":true,
"expanded":true,
"leaf":true
},{
"id":"child2",
"iconCls":"icon-pkg",
"text":"子节点二",
"singleClickExpand":true,//单击节点是否展开
"expanded":true,
"leaf":false,
"children":[{
"id":"child21",
"iconCls":"icon-pkg",
"text":"子节点三",
"singleClickExpand":true,//单击节点是否展开
"expanded":true,
"leaf":true
}]
}]
};
相关文章推荐
- extjs 3.31 TreeGrid实现静态页面加载json到TreeGrid里面
- Android 以JSON格式存储和加载本地文件
- extjs JsonStore加载数据,Combobox只显示最后一项值问题
- easyui tree 的异步加载 前台的编写方法和后台的json数据格式组装方法
- 返回easyui/extjs中datagrid使用的json格式
- ExtJs树的递归算法(Java),Json格式
- Extjs 3.31 TreeGrid 我的小改动,实现静态页面加载json到TreeGrid里面
- ExtJs与JSON格式数据绑定的方法
- extjs JsonStore加载数据,Combobox只显示最后一项值问题
- VS2013无法加载JSON格式
- extjs Post方法提交json格式的数据到php
- ArcGIS Android应用客户端加载JSON格式业务数据
- 【ExtJS实践】之六 :Combobox从后台获取JSON格式的数据
- ExtJs动态生成treepanel的Json格式
- ExtJs树的递归算法(Java),Json格式
- 使用getJSON()方法异步加载JSON格式数据
- 用C#实现多叉树的生成并转化为extjs(基于js脚本的ajax UI框架)的TreeNode的json数据格式(格式为Id,Pid,Text)
- extjs JsonStore加载数据,Combobox只显示最后一项值问题
- hive加载json格式文件的方法
- extjs 3.31 TreeGrid实现静态页面加载json到TreeGrid里面