How to highlight the last node of a tree in dojo programatically?

216 views Asked by At

Can someone suggest me how can I highlight the last node of a tree in dojo. I tried the _onfocus() function but it isnt working. I am using dojo 1.7 version.

I want to find the last node of my tree structure based on the node id and then highlight it.

Appreciate for all your suggestions in this.

Thanks

1

There are 1 answers

3
dori naji On

It All depend on the store regarding how you want to get the node. but for example if you are using a memory store and the objectstoremodel like the one in the dojo documentation then you can do that to get the tree node:

tree.model.store.query({ id: WhatevertheIDYouAreLookingFor});

Then you need to use the function path, arrays is the tree path you want to select so for this example below it will highlight Nairobi the rest of the information is for dojo to find its way through the tree. please refer to this documentation

mytree.set('path', ['world', 'AF', 'KE', 'Nairobi'] )