ludo / jquery-treetable

jQuery plugin to show a tree structure in a table
http://ludo.cubicphuse.nl/jquery-treetable
GNU General Public License v2.0
741 stars 278 forks source link

Remove sub-node check is not working on initializing first time tree #215

Open RG2712 opened 6 years ago

RG2712 commented 6 years ago

I have issue while initializing the tree data. On initializing, parent sub-nodes check is not working. parentDom.parent().find(".class-level").length always gives me length 0 even if it is a parent node

this is the code I wrote on initialize: settings.onInitialized(function (_data) { settings.selectData = _data.TaskTypes; var data = _data.ProjectTasks; for (var i = 0; i < data.length; i++) { var row = { id: data[i].Id, level: data[i].Level, pid: data[i].PId, name: data[i].Name, taskType: data[i].TaskType, startDate: data[i].StartDate, endDate: data[i].EndDate }; var treenode=generateTreeNode(dom_table, row, row.level); treeData[row.id] = row; var expendIcon = dom_table.find("li.j-expend"); if (expendIcon.parent().attr("data-loaded")) { //toggleicon($(expendIcon)); //toggleExpendStatus(expendIcon, treenode); } } settings.bindDropDown(); });

Please suggest

RG2712 commented 6 years ago

Please suggest