简体   繁体   English

Dojo:使用CSS选择器识别Dijit树节点

[英]Dojo: identifying dijit tree nodes with css selectors

Is there any way to select a group of nodes in a dijit tree having some property/flag? 有什么方法可以在dijit树中选择具有某些属性/标志的一组节点?

Alternatively, can I add a CSS selector to those nodes so I can do operations on all of them in one go? 另外,是否可以向这些节点添加CSS选择器,以便一次完成所有节点的操作?

I understand dojo.query() can help with the selection part but how do I apply the selectors in the first place> 我知道dojo.query()可以帮助选择部分,但是我如何首先应用选择器>

I tried adding a 'span' in the 'name' attribute of the json array(my data source) but it is parsed as text instead of a DOM object. 我尝试在json数组的“名称”属性(我的数据源)中添加“跨度”,但它被解析为文本而不是DOM对象。

是的,您可以根据它们所在的路径来选择它们,请参阅http://dojotoolkit.org/reference-guide/1.10/dijit/Tree-examples.html中的文档

mytree.set('paths', [ ['world', 'AF', 'KE', 'Nairobi'], ['world', 'SA'] ] );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM