[英]Does jquery checkbox tree support the ability to “expand until node” or “expand parents” when programatically calling “check”?
I am using the jquery checkboxtree plugin which works great and has good documentation and examples in the link above. 我正在使用jquery checkboxtree插件 ,该插件很好用,并且在上面的链接中有很好的文档和示例。 I now have a situation where I want to programmatically check a node.
现在,我想以编程方式检查节点。 This is supported using the following syntax:
使用以下语法支持此功能:
$('#tabs-5-check').click(function(){
$('#tree5').checkboxTree('check', $('#tabs-5-node23'));
});
but the issue is that this is not useful unless all of the parent nodes are already expanded. 但是问题在于,除非所有父节点都已展开,否则这将无用。 ( if the parent nodes are collapsed, then you don't even realized that anything has happened )
( 如果父节点已折叠,那么您甚至都没有意识到发生了什么事 )
I am trying to figure out if there is any way to "expand until" or "expand parents" when I programmatically check a node so it not only checks the node but ALSO expands parent nodes so that node that I have chosen to check is visible? 我试图找出以编程方式检查节点时是否有任何方法可以“扩展到”或“扩展父对象”,这样它不仅可以检查节点,还可以扩展父节点,从而使我选择检查的节点可见?
It seems like this is supported at initialization time using this option: 似乎在初始化时使用以下选项可以支持此功能:
$('#areaTree').checkboxTree({
initializeChecked: 'expanded',
but I don't see how that can be applied when checking items programatically after initiatization. 但是在初始化后以编程方式检查项目时,我看不到该如何应用。 Is this possible using this jquery plugin?
使用这个jQuery插件可以吗?
and I was hoping that I could expand multiple nodes using a class name like this 我希望我可以使用这样的类名扩展多个节点
$('#tabs-5-expand').click(function(){ $('#tree5').checkboxTree('expand', $('.bluetabs')); }); $('#tabs-5-expand')。click(function(){$('#tree5')。checkboxTree('expand',$('。bluetabs'));});
This worked for me: 这为我工作:
$('#tabs-5-expand').click(function(){
$('#tabs-5-node23').parents('li').each(function() {
$('#tree5').checkboxTree('expand', $(this));
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.