Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #109918
    Hazwani Razak
    Participant

    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?

    #109921
    Markov
    Keymaster

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.