Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.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 Select_all()函数_Javascript_Jquery_Jquery Plugins_Jstree - Fatal编程技术网

Javascript 正确使用Jstree Select_all()函数

Javascript 正确使用Jstree Select_all()函数,javascript,jquery,jquery-plugins,jstree,Javascript,Jquery,Jquery Plugins,Jstree,嗨,我的网站上有jstree组件。我正在尝试使用select_all()函数选择我的所有树节点 我的jstree id是“jstree” 我试着像 $('#jstree').select_all.jstree(); 但它不起作用 我也试着喜欢 $('#jstree').select_all(); 及 如何在脚本中使用此函数?非常感谢您的帮助。请尝试以下方法: $('#jstree').jstree('select_all'); 应要求,我正在解释 我从未使用过jstree,但据我

嗨,我的网站上有jstree组件。我正在尝试使用select_all()函数选择我的所有树节点

我的jstree id是“jstree”

我试着像

  $('#jstree').select_all.jstree();
但它不起作用 我也试着喜欢

  $('#jstree').select_all();

如何在脚本中使用此函数?非常感谢您的帮助。

请尝试以下方法:

$('#jstree').jstree('select_all');
应要求,我正在解释

我从未使用过jstree,但据我在文档中所读到的,它扩展了Jquery,所有扩展Jquery的插件都有两种方法调用方法,1是通过返回插件实例var plugin=$('selector').data('pluginname');plugin.methodName()。
其他人只是简单地执行$('selector').pluginname('methodName'),这可能是jstree的情况。

您能对您的答案提供更多解释吗?一般来说,只有代码的答案被认为是低质量的。它是有效的!但是我如何使用它的suppress事件,比如'true',或者如果它返回一些值,比如array,那么如何获取这个数组呢?获取数组:var valuesArray=$('jstree')。jstree('select#all');关于镇压,我甚至不知道那是为了什么。:)要使用'suppress event'参数,请使用
$('jstree').jstree('select#all',true)。您还可以通过以下方式向其他方法添加参数:)
$('#jstree').jstree('select_all');