JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › General Discussions › Smart Tree dataset attributes
Tagged: writing. Thesis writing.
Hi, I would like to add some dataset attributes to smart tree nodes using the datasource, how can I do that? If cannot, how do I loop through all the nodes to assign attributes?
Hi,
You can use document.querySelectorAll(‘smart-tree-item’); and loop through the collection of nodes
const items = document.querySelectorAll('smart-tree-item'); [].forEach.call(items, function(item) { // do whatever });
Regards, Markov