我正在使用jsTree插件列出文件系统中的文件夹.我需要阻止用户在满足某个条件之前更改到另一个节点.
下面的代码并没有停止传播...我看到了一些其他插件的解决方案,但这是一个简单的任务,必须可以在没有其他插件的情况下完成.
$('#jstree').on('select_node.jstree', function (e)
{
if (!changeAllowed()
{
e.preventDefault();
e.stopImmediatePropagation();
}
});
Run Code Online (Sandbox Code Playgroud)