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();
});
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