Extjs中 关于treePanel的demo实例
来源:互联网 发布:java影院售票系统 编辑:程序博客网 时间:2024/06/05 17:59
之前两个项目都开发过公司项目的部门组织,和行政区域模块,这些模块web都会涉及到关于组织结构树的构建和使用;先说说Extjs中对于树提供了支持:分别有Ext.tree.Panel和Ext.data.TreeStore;
先看一个比较简单的tree demo:
<!doctype html><html lang="en"> <head> <meta charset="UTF-8"> <link href="d:\130566\Desktop\ExtjsDemo\ext-all.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src='d:\130566\Desktop\ExtjsDemo\ext-all.js' ></script></script> <script type="text/javascript">Ext.onReady(function(){Ext.application({name:'HelloExt',launch:function(){var store = Ext.create('Ext.data.TreeStore', {root: {expanded: true,children: [ {text:'中国',expanded: true,children:[{ text: "北京", leaf: true },{ text: "上海", expanded: true, children: [{ text: "黄浦", leaf: true },{ text: "浦东", leaf: true}] },{ text: "重庆", leaf: true }]}]}});Ext.create('Ext.tree.Panel', {title: 'Simple Tree',width: 400,height: 250,useArrows:true,//使用Vista-style样式的箭头。rootVisible: true, //是否隐藏根节点autoScroll:true,margin:false, border : false,animate:true, //动画效果store: store,viewConfig: {plugins: { ptype: 'treeviewdragdrop',appendOnly:true }},renderTo: Ext.getBody()}); } });}); </script> </head> <body> </body></html>【注】:该demo 中所提供的数据缓存是来自于界面构件好的,但是项目中我们构建一颗树的时候 , 肯定数据都是动态的; 都是从后台拼接好json 之后传递过来的。
下面看一个demo :
<!doctype html><html lang="en"> <head> <meta charset="UTF-8"> <link href="d:\130566\Desktop\ExtjsDemo\ext-all.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src='d:\130566\Desktop\ExtjsDemo\ext-all.js' ></script></script> <script type="text/javascript">Ext.onReady(function(){Ext.application({name:'HelloExt',launch:function(){Ext.define('newDemo.TreeStore',{extends:'Ext.data.TressStore',autoSync:true,proxy:{type:'ajax',url:'/ XXXX.action',},root:{id:'01', //根路径text:'中国',expanded:true,},sorters : [{property : 'leaf',direction : 'ASC'}]});Ext.create('Ext.tree.Panel', {title: 'Simple Tree',width: 400,height: 250,useArrows:true,//使用Vista-style样式的箭头。rootVisible: true, //是否隐藏根节点autoScroll:true,margin:false, border : false,animate:true, //动画效果store: Ext.create('newDemo.TreeStore'),viewConfig: {plugins: { ptype: 'treeviewdragdrop',appendOnly:true }},renderTo: Ext.getBody()}); } });}); </script> </head> <body> </body></html>前端可以这样构造,但是后端的数据需要构造一个树结构的ArrayList<treeNodes>的集合数据,
0 0
- Extjs中 关于treePanel的demo实例
- ExtJS中TreePanel的使用
- ExtJs之treePanel实例
- extjs中treepanel例子
- extjs中treepanel例子
- Extjs的TreePanel
- extjs 的treepanel设置
- Extjs TreePanel的应用
- ExtJS 的TreePanel
- 关于 extjs treepanel 复选框 选中 父节点 的问题
- EXTJS中TreePanel和TabPanel配合使用的问题
- extjs treepanel
- extjs中treepanel属性和方法
- extjs中treepanel属性和方法
- extjs中treepanel属性和方法
- extjs中treepanel属性和方法
- extjs中treepanel(含栗子)
- 关于Combox和TreePanel的混用(Combox中包含TreePanel)
- django的orm指定字段名,表名
- Hibernate新增一条记录,主键为varchar类型的解决办法
- dede 织梦图集上传图片302错误解决办法
- C#XmlDocument无法读取utf-16文件
- h264CAVLC编码实例
- Extjs中 关于treePanel的demo实例
- 在Linux环境下安装部署Oracle 10g-(3)
- FZU2147 A-B Game(贪心)
- 高流量网站使用阿里云主机最具性价比的方式
- jquery mobile修改原样式css
- 微信公众号推广有什么作用?能带来什么效益呢、
- Linux串口调试配置_GRUB串口通信_串口登陆
- C语言程序架构
- CAD控件 出三维控件!和手机CAD控件了,欢迎大家使用!