首页 新闻 会员 周边 捐助

Ext tree 一次性加载的问题?

0
悬赏园豆:40 [待解决问题]

关于Ext Tree树形菜单一次性加载,我在后台返回全部数据,在我点击节点后再次请求后台。这里想要的是我点击节点直接展开下面的子节点,不需要再次请求后台,希望指导下。谢谢。代码如下:

 1      var rightsStore = Ext.create('Ext.data.TreeStore', {
 2                     autoLoad: true,//自动加载
 3                     
 4                     fields: [                       
 5                         'FuncID', 'ParentFuncID', 'FuncName', 'FuncTitle', 'FuncType', 'PicUrl',
 6                         'ListOrder', 'HelpUrl', 'Enabled', 'Remark', 'FuncUrl'
 7                     ],//数据字段
 8                     proxy: {
 9                         type: 'ajax',
10                         actionMethods: {
11                             read: 'post'
12                         },
13                         url: '/ASHX/SystemModel/Roles/Roles.ashx?option=GetRights'
14                     },
15                     root: {
16                         FuncTitle: '系统',
17                         FuncID: '',
18                         left: false,
19                         expanded: true
20                     },
21                     listeners: {
22                         beforeload: function (treeStore, opration, opt) {
23                             
24                         }
25                     }
26                 });
27                 var rightsTree = Ext.create('Ext.tree.Panel', {
28                     rootVisible: true,
29                     displayField: 'FuncTitle',
30                     store: rightsStore,
31                     useArrows: true,
32                     autoScroll: true,
33                     animate: true,
34                     checked: true,
35                     containerScroll: true,
36                     listeners: {
37                         'itemclick': function (projectTree, record, item, index, e, eOpts) {
38                             
39                         }
40                     }
41                 });
42                 //创建window
43                 Ext.create("Ext.window.Window", {
44                     title: "权限设置",
45                     id: 'ProjectName',
46                     width: 350,
47                     height: 400,
48                     autoScroll: true,
49                     draggable: false,
50                     autoDestroy: true,
51                     loader: false,
52                     modal: true,//遮挡背后一切,只显示当前window
53                     layout: "fit",
54                     items: [rightsTree]
55                 }).show();

后台返回的数据:

1 [{"FuncID":"6a0c3233-c09c-49d4-aa26-d66877482f70","PraentFuncID":"                                    ","FuncTitle":"12323","Children":[{"FuncID":"f624fdae-fe42-42bc-ae40-cfa3823c6f14","PraentFuncID":"6a0c3233-c09c-49d4-aa26-d66877482f70","FuncTitle":"大幅度","Children":null,"leaf":true,"checked":false}],"leaf":false,"checked":true},{"FuncID":"a9882cc2-6b97-4720-94bf-49e76b4eea79","PraentFuncID":"                                    ","FuncTitle":"1232","Children":[],"leaf":true,"checked":false}]

changsen-的主页 changsen- | 初学一级 | 园豆:29
提问于:2015-06-24 22:04
< >
分享
所有回答(2)
0

自己已经解决了!~

changsen- | 园豆:29 (初学一级) | 2016-11-29 22:58
0

我是Ext5也遇到了你的问题请问是如何解决的谢谢!!!

亚丁号 | 园豆:202 (菜鸟二级) | 2017-01-24 11:25
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册