-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eleTree组件拖动节点时判断是否超出边界的代码有问题 #92
Comments
@muyunzhongtian 多谢提醒,之前没太注意到,修改之后通过获取节点的属性组成字符串查找 |
建议使用:target.parents(options.elem.selector).length===0 进行判断 |
您的这种修改方案是硬生生的把节点的属性全部拼接到选择器中,其实options.elem已经提供了选择器了,不用再手动创建选择器了,截图如下:
这样就可以了
// 判断是否超出边界
if(target.parents(options.elem.selector).length===0 && !isTargetOuterMost){
return;
}
昨天忘了贴解决方案了,勿怪
[email protected]
发件人: 李祥
发送时间: 2020-01-09 09:58
收件人: hsiangleev/layuiExtend
抄送: muyunzhongtian; Mention
主题: Re: [hsiangleev/layuiExtend] eleTree组件拖动节点时判断是否超出边界的代码有问题 (#92)
@muyunzhongtian 多谢提醒,之前没太注意到,修改之后通过获取节点的属性组成字符串查找
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@muyunzhongtian 额,谢谢,我感觉应该有这个api,找了半天没找到,就自己拼接选择器了。。。 |
大神,给您提几个建议吧,如有冒犯,还望见谅啊。
现在节点拖动时只能实现改变父子关系的功能,以后是否考虑增加改变同级节点的上下排序的功能呢??还有,目前只有checkbox的功能,以后是否考虑增加radio的功能呢??
因为我之前项目中用过zTree,这些功能zTree中都有,现在改用layui框架了,如果eleTree也有这些功能,那就完美了呢。
[email protected]
发件人: 李祥
发送时间: 2020-01-09 10:56
收件人: hsiangleev/layuiExtend
抄送: muyunzhongtian; Mention
主题: Re: [hsiangleev/layuiExtend] eleTree组件拖动节点时判断是否超出边界的代码有问题 (#92)
@muyunzhongtian 额,谢谢,我感觉应该有这个api,找了半天没找到,就自己拼接选择器了。。。
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@muyunzhongtian 哪里哪里,大神这个词叫的我有点慌。。。
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
场景描述:页面上有两棵树,两棵树均允许节点拖动
操作描述:拖动一棵树的节点到另一棵树上
期望结果:被拖动的节点不会添加到另一棵树上
实际结果:被拖动的节点添加到另一棵树上
结论:eleTree组件拖动节点时判断是否超出边界的代码有问题
jquery的parents()方法传入的参数应该是选择器(也就是字符串),而options.elem此时已经是对象了,导致 target.parents(options.elem).length===0 条件不成立,不能return
The text was updated successfully, but these errors were encountered: