[Dojo-interest] TreeWidget: how to get current node on createChild

Jason Cline jason.cline at gmail.com
Sat Apr 1 21:10:25 MST 2006


I'm assuming you are using  something similar to the TreeContextual
menu provided in the examples to invoke createChild.

'parent' is the JSON encoded rep. of the node you clicked on (or is
selected in the tree) to create the child.
'index' is the position under the parent node to add the child.

This is the default behavior of the tree.  If you are trying to click
on a node and create a sibling of the clicked node, then you could
probably do something on the server side to insert before or after the
'parent' node.

Jason

On 4/1/06, Steve B. <steve at browsermedia.com> wrote:
> I am working with the TreeWidget. I am creating .jsp(s) (invoked as RPCUrl) which use a database to
> maintain tree data. I am using a download from ~1 week ago. So far so good - thanks for the
> excellent widget. I also appreciate the answers to many question I have found in this list's archives.
>
> I am now working with createChild. For development and debugging, I echo all param values (as
> Strings). In getChildren and removeNode I find a parameter- or JSON- value which gives me
> selected-node information. However, for createChild, I only see:
>
>      index = 0
>      action = createChild
>      dojo.preventCache = 1143945907736
>      data = {"suggestedTitle":"New node"}
>      tree = [object Object]
>      parent = [object Object]
>
> How do I get the selected node to which I am trying to add the child?
>
> TIA,
>
> Steve B.
>
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>


More information about the Dojo-interest mailing list