gpt4 book ai didi

dojo - 如何禁用 dijit.Tree 中的多个节点选择?

转载 作者:行者123 更新时间:2023-12-05 01:07:51 27 4
gpt4 key购买 nike

如何在dijit.Tree中设置单选模式?我所说的单一选择模式的意思是用户不应该能够通过使用 shift 键或 ctrl 键 + 鼠标单击节点来选择多个节点。

最佳答案

选择由 dijit/Tree::dndController 处理,默认为 dijit/tree/_dndSelector_dndSelector 中有一个属性singular,其文档说明:

singular: Boolean

Allows selection of only one element, if true.

Tree hasn't been tested in singular=true mode, unclear if it works.

无论如何,它似乎有效:

var tree = new dijit.Tree({
id: "tree1",
model: model
}).placeAt(win.body());

tree.dndController.singular = true;

在 jsFiddle 查看:http://jsfiddle.net/phusick/UxWUs/

关于dojo - 如何禁用 dijit.Tree 中的多个节点选择?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12261723/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com