hcker2000
hcker2000

Reputation: 615

jstree add new node without providing input for the text?

I have a form for new jstree nodes as I need to store more data than just the name of the node. So I have a title field that I am using for the nodes name/title. The only problem is that that when I run the command to add the new node it does so but provides and input that your supposed to type the jstree node name/title in.

It has the text I passed it from the form in there I just don't want it to show the input and make the user hit enter.

I have tried running a enter keypress event on the returned node with no luck. Here is the bit of code in question.

        var new_node = js_tree.jstree('create', null, 'last', {'data': link_text});
        var e = jQuery.Event("keydown");
        e.which = 13; // # Some key code value
        e.keyCode = 13
        new_node.trigger(e);

Upvotes: 4

Views: 2533

Answers (1)

hcker2000
hcker2000

Reputation: 615

Ok some how I missed this when searching but here is the answer on another post: creating a new node in jstree

Upvotes: 3

Related Questions