Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/460.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.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 JsTree,限制搜索深度_Javascript_Jquery_Jstree - Fatal编程技术网

Javascript JsTree,限制搜索深度

Javascript JsTree,限制搜索深度,javascript,jquery,jstree,Javascript,Jquery,Jstree,我想将搜索结果仅限于特定文件夹中的节点。有没有办法指定搜索深度?如果不可能,我如何过滤搜索结果?以下是一个示例用法: jQuery("#jsTree").bind("loaded.jstree", function(event, data) { }).jstree({ "core": {}, "json_data": { // Ajax request to load data }, "themes": { "theme": "cl

我想将搜索结果仅限于特定文件夹中的节点。有没有办法指定搜索深度?如果不可能,我如何过滤搜索结果?

以下是一个示例用法:

jQuery("#jsTree").bind("loaded.jstree", function(event, data) { }).jstree({
    "core": {},
    "json_data": {
        // Ajax request to load data
    },
    "themes": {
        "theme": "classic",
        "dots": true,
        "icons": true
    },
    "types": {
        "types": {
            "max_children": -2,
            "max_depth": -2
        }
    }
});

您可以使用max_depth和max_children参数来限制树

以下是一个示例用法:

jQuery("#jsTree").bind("loaded.jstree", function(event, data) { }).jstree({
    "core": {},
    "json_data": {
        // Ajax request to load data
    },
    "themes": {
        "theme": "classic",
        "dots": true,
        "icons": true
    },
    "types": {
        "types": {
            "max_children": -2,
            "max_depth": -2
        }
    }
});

您可以使用max_depth和max_children参数来限制树

要筛选只包含搜索匹配项的树,请使用内置搜索选项show_only_匹配项:

    $("#MyTree").jstree({ 
        "search" : {  "case_insensitive" : true,
            "show_only_matches" : true
        },
    "plugins" : [ "html_data", "ui", "themeroller","search" ]
    });

要仅使用搜索匹配项筛选树,请使用内置搜索选项show_only_matches:

    $("#MyTree").jstree({ 
        "search" : {  "case_insensitive" : true,
            "show_only_matches" : true
        },
    "plugins" : [ "html_data", "ui", "themeroller","search" ]
    });

JsTree的类型和搜索插件是不相关的。为类型指定最大深度与搜索深度之间没有关系。JsTree的类型和搜索插件是不相关的。为类型指定最大深度与搜索深度之间没有关系。