[Dojo-interest] To select a node in the tree automatically

theKryz Treschklingen at gmail.com
Fri Aug 8 12:16:39 UTC 2008


Hi sajan,

as far as I understand the tree widget, you have to retrieve the node first.
This is not a big problem, if the newly created node is visible. If it is
invisible, you'll have to make it visible first.
All visible nodes can be accessed through "T._itemNodeMap" . The "_" marks
it as private, so obviously not the wanted solution, but I don't know of
another one.

Let's say you defined your identifier as "id", then you can retrieve the
node by 
node = T._itemNodeMap[id]
You have to pass the id of the node you want to retrieve. 

Hope this helps
chris



Sajan wrote:
> 
> Hi friends,
>          How to select a node in the tree automatically. Means the newly
> created node should be selected.
> we have focusNode(), perhaps we need to pass the node here.
> My intention is: Add item in the tree and select that item in the tree.
> And
> also want to execute the onSelect node event that is published.
> 
> For eg: I have a tree, T. [T = new Tree()]
> published selectNode() to be executed when a node is been selected.
> Adding nodes to the tree using ItemFileWriteStore object, say Store.
> [Store
> = new Store(data)]
> When I do newItem to store, I have onNewItem(item) event.
> [Store.newItem(NewNode)]
> 
> Now my requirement: When I do newItem to the store, I need the newly
> created
> node, [NewNode], to be selected node
> and the event selectNode() should be invoked.
> 
> Since I am using the store, nowhere we get the node unless we select any.
> 
> What to do in this case? Any solution or any trick???? :)
> 
> 
> -- 
> regards.
> sajan.
> --------------------------------------------------------
> It is the thought that always matters...
> --------------------------------------------------------
> 
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at dojotoolkit.org
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
> 
> 

-- 
View this message in context: http://www.nabble.com/To-select-a-node-in-the-tree-automatically-tp18890379p18890829.html
Sent from the Dojo mailing list archive at Nabble.com.



More information about the Dojo-interest mailing list