How create node with contextmenu then receive event AFTER name input?

452 views
Skip to first unread message

RemotePortal

unread,
Jun 9, 2010, 5:42:49 AM6/9/10
to jsTree
I need an event fired after the user names a new node.

I configured a context menu item to create a child node. I've
attempted to capture the event TWO ways and neither works:

A) In the contextmenu action: function I do this:

$("#mytree").jstree("create",node,"first", {},function(tree,node){
attr: {rel: 'mynodetype'}
},function(tree,node){
log('called, BUT, it's called BEFORE node is named by user..
kinda useless');
});

I appreciate this callback but it's called prematurely before user
names the object. I personally don't see any value to that. Can you
consider changing that to fire AFTER the user is done typing the name
in the new node?

B) During configuration I bind to create_node:

$("#site_tree")
.bind("create_node.jstree", function(e,data) { log('event: ' +
e.type); }

This event isn't fired at all that I can see.

C) I don't see a rename event fired (hoping the name would cause a
rename event at least).

How do I get this event so I can do AJAX and update the server with
the name of the new node?

Thanks again!
Pete

Ivan Bozhanov

unread,
Jun 9, 2010, 5:47:20 AM6/9/10
to jstree
Hi,

Try the "create.jstree" event :)

Cheers,
Ivan

> --
> You received this message because you are subscribed to the Google Groups "jsTree" group.
> To post to this group, send email to jst...@googlegroups.com.
> To unsubscribe from this group, send email to jstree+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jstree?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages