How to append <div> HTML for node? create_node.jstree and load_node.jstree never seem to fire...

2,356 views
Skip to first unread message

Peter Valdemar Mørch

unread,
Nov 26, 2015, 10:51:32 AM11/26/15
to jsTree, Peter Valdemar Mørch

Hi,

I'm trying to replace our ancient YUI tree that looks like this:



I've tried jstree-grid but it apparently can't hande if the data contents are more than one line. And sometimes the contents of a tree (marked by the red arrows) are more than one line in our case. So I'm trying with jsTree-only.

Using jsTree I've tried adding some test markup after the id with jQuery, and it works somewhat and seems to render fine.

I just don't know to ensure that my custom markup always would get added to the nodes.

I've tried binding to create_node.jstree and load_node.jstree, but they don't ever fire. Why is that?

I've created a jsFiddle to try this: http://jsfiddle.net/pmorch/pPWgd/42/ (look for output in your console and comments at top of JS)

Is adding custom HTML to the nodes going to give me problems down the road I'm not seeing yet?

Sincerely,

Peter

Peter Valdemar Mørch

unread,
Nov 26, 2015, 11:03:56 AM11/26/15
to jsTree, pe...@morch.com
I figured it out. It is so incredibly easy to create a plugin. A testament to a great API and implementation. Thanks, Igor!

http://jsfiddle.net/pmorch/uLkh3h1c/1/

Peter

Ivan Bozhanov

unread,
Dec 30, 2015, 2:14:12 PM12/30/15
to jsTree, pe...@morch.com
I am glad you figured it out - sorry I was not able to help sooner.

Best regards,
Ivan
Reply all
Reply to author
Forward
0 new messages