chooseMenu: function(_this) {

        //var mycomp = top.Ext.getCmp("my_comp");
        var menuTreeStore = Ext.data.StoreManager.lookup('menuTreeStore_'+_this.node);
        if (!menuTreeStore) {
            menuTreeStore = Ext.create('app.store.MenuTreeStore', {
                pid: _this.node,
                storeId : 'menuTreeStore_'+_this.node,
                myid : _this.node,
                mynode : _this.node,
                isLoading : 0,
                proxy: {
                    pid: _this.node,
                    id: _this.node,
                    node: _this.node
                },
                listeners: {
                    nodebeforeexpand: function (_this, eOpts) {
                        //设置节点id
                        if(_this.id == "root") {
                            this.mynode = _this.store.mynode;
                        } else {
                            this.mynode = _this.data.id;
                        }
                        //isLoading 是否自定义URL加载
                        this.isLoading = _this.data.isLoading;
                        //action 自定义URL
                        this.action = _this.data.action;
                    },

                    beforeload: function (store, operation, opts) {
                        //传参节点id作为子树的父节点
                        Ext.apply(store.proxy.extraParams, {
                            node: this.mynode
                        });
                        //isloading ==1 如果节点展开动作为加载为自定义URL, 设置proxy的url为指定的action
                        if(this.isLoading == 1) {
                            store.proxy.url = this.action;
                        } else {
                            store.proxy.url = store.originalUrl || store.proxy.url;
                        }
                    },

                    load: function (store, operation, opts) {
                        //加载自定义url设为0
                        this.isLoading = 0;
                    }
                }
            })
        }

        var menuTree = Ext.getCmp("menuTree");
        menuTree.setStore(menuTreeStore);
    }

 

相关文章:

  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2021-12-15
  • 2021-06-08
  • 2022-03-05
猜你喜欢
  • 2021-12-07
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-11-26
  • 2021-06-15
相关资源
相似解决方案