Tag Archives: jsTree

jsTree/jQuery, Dynamic Node Addition

jsTree is a jQuery plugin allowing easy integration of interactive trees. Both products are well supported, pervasive and useful. Creating the static jsTree is trivial, but the syntax for dynamically editing the tree after the ‘ready.jstree’ event can be difficult for the newcomer.

My specific use case was to create the tree based on the result from an external web service call. The call finished long after the tree was loaded, so the JSON result needed parsed, and the tree updated.

JSFiddle showing functionality.

Screenshot in case JSFiddle is down:

screenshot