Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript extjs:如何用树节点填充组合框';什么是直系子女?_Javascript_Extjs - Fatal编程技术网

Javascript extjs:如何用树节点填充组合框';什么是直系子女?

Javascript extjs:如何用树节点填充组合框';什么是直系子女?,javascript,extjs,Javascript,Extjs,我有一棵树和一个组合框 我需要获取节点1的直接子节点,并将它们放在组合框中 从组合框列表中选择节点时,树应仅显示该节点及其子节点 基本上,组合框用作过滤器,仅显示特定节点。除选定节点之外的所有节点都将隐藏 任何帮助都将不胜感激。请在Ext JS API文档中查找过滤功能。在左上角的“查找类”中,您可以通过输入字符串过滤树。我认为你想做的与此非常相似: 在: filterTree:函数(t,e){ var text=t.getValue(); Ext.each(this.hiddenPkgs,

我有一棵树和一个组合框

  • 我需要获取节点1的直接子节点,并将它们放在组合框中

  • 从组合框列表中选择节点时,树应仅显示该节点及其子节点

  • 基本上,组合框用作过滤器,仅显示特定节点。除选定节点之外的所有节点都将隐藏


    任何帮助都将不胜感激。

    请在Ext JS API文档中查找过滤功能。在左上角的“查找类”中,您可以通过输入字符串过滤树。我认为你想做的与此非常相似:

    在:

    filterTree:函数(t,e){
    var text=t.getValue();
    Ext.each(this.hiddenPkgs,函数(n){
    n、 ui.show();
    });
    如果(!text){
    this.filter.clear();
    返回;
    }
    这个。expandAll();
    var re=new RegExp(“^”+Ext.escapeRe(text),“i”);
    this.filter.filterBy(函数(n){
    return!n.attributes.isClass | | re.test(n.text);
    });
    //隐藏未过滤的空包
    this.hiddenPkgs=[];
    var me=这个;
    this.root.cascade(函数(n){
    如果(!n.attributes.isClass&&n.ui.ctNode.offsetHeight<3){
    n、 ui.hide();
    me.hiddenPkgs.push(n);
    }
    });
    },
    
    在Ext JS API文档中查找过滤功能。在左上角的“查找类”中,您可以通过输入字符串过滤树。我认为你想做的与此非常相似:

    在:

    filterTree:函数(t,e){
    var text=t.getValue();
    Ext.each(this.hiddenPkgs,函数(n){
    n、 ui.show();
    });
    如果(!text){
    this.filter.clear();
    返回;
    }
    这个。expandAll();
    var re=new RegExp(“^”+Ext.escapeRe(text),“i”);
    this.filter.filterBy(函数(n){
    return!n.attributes.isClass | | re.test(n.text);
    });
    //隐藏未过滤的空包
    this.hiddenPkgs=[];
    var me=这个;
    this.root.cascade(函数(n){
    如果(!n.attributes.isClass&&n.ui.ctNode.offsetHeight<3){
    n、 ui.hide();
    me.hiddenPkgs.push(n);
    }
    });
    },
    
    filterTree: function(t, e){
        var text = t.getValue();
        Ext.each(this.hiddenPkgs, function(n){
            n.ui.show();
        });
        if(!text){
            this.filter.clear();
            return;
        }
        this.expandAll();
    
        var re = new RegExp('^' + Ext.escapeRe(text), 'i');
        this.filter.filterBy(function(n){
            return !n.attributes.isClass || re.test(n.text);
        });
    
        // hide empty packages that weren't filtered
        this.hiddenPkgs = [];
            var me = this;
        this.root.cascade(function(n){
            if(!n.attributes.isClass && n.ui.ctNode.offsetHeight < 3){
                n.ui.hide();
                me.hiddenPkgs.push(n);
            }
        });
    },