如何根据节点选择性地允许 SmartGWT TreeGrid 重定父级

发布于 2024-09-09 09:53:48 字数 306 浏览 0 评论 0原文

我的 SmartGWT TreeGrid 对象中有以下数据。

Home
 |-Room 1
 |-Room 2
    |-Table
    |-Chair

通过调用 treeGrid.setCanReparentNodes(true); 允许重新设置父级

;我只想允许选择性重新设置父级:例如,应该可以将表移动(拖放)到 Room 1,但它应该无法将 Room 1 移至 Room2 或将椅子移至 Home。

如何根据节点类型(或节点的属性)有选择地允许重新设置父级?

I have the following data in a SmartGWT TreeGrid object.

Home
 |-Room 1
 |-Room 2
    |-Table
    |-Chair

Reparenting is allowed by calling treeGrid.setCanReparentNodes(true);

I want to allow selectiv reparenting only: for example, it should be possible to move (drag&drop) the Table to Room 1, but it should not be possible to move the Room 1 into Room2 or the Chair into Home.

How can I selectively allow reparenting depending on the node type (or a node's attribute)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文