maxazan / jquery-treegrid

TreeGrid plugin for jQuery
http://maxazan.github.io/jquery-treegrid
MIT License
553 stars 222 forks source link

Create new nodes in runtime #10

Open mustax opened 10 years ago

mustax commented 10 years ago

It's possible to add new nodes to the grid and make the expand/collapse work? I can't figure it out how.

Thaks.

mgoffan commented 10 years ago

I got this to work

$('<tr class="treegrid-parent-'+id+' treegrid-temp"><td class="special"></td></tr>').insertBefore($(next));
var settings = $.extend({}, $.fn.treegrid.defaults);
 $('.treegrid-temp').treegrid('initNode', settings);

where next is other node(tr)

lesterjanpearson commented 9 years ago

there will be an issue when the child node your adding is not next to the parent node. trying to figure it out myself.