The expected outcome is that the Node object would have hasChildren populated. When it gets to Parse, this attribute is omitted and the Treeview Node doesn't have the styling that allows you to see what the children are.
var securitySelectionModelData = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "../../getSavedClassificationModel/{{ id }}",
contentType: "application/json",
datatype: "json",
}
},
schema: {
type: "json",
model: {
id: "id",
hasChildren: "hasChildNode"
},
parse: "",
data: function(data){
if (data.length > 0){
return data;
} else {
return [data];
}
}
parse: function(response) {
var nodes = [];
if(response.parent == null){
var node = {
id: response.id,
currWeight: response.currWeight,
tgtWeight: response.tgtWeight,
parentId: response.parent,
hasChildren: response.hasChildNode,
SSM_id: response.SSM.id,
ext_model_id: response.ext_model_id,
securitySelectionModelName: response.SSM.securitySelectionModelName,
classificationNameNode: response.classificationNameNode
};
}
else {
var node = {
id: response.id,
currWeight: response.currWeight,
tgtWeight: response.tgtWeight,
hasChildren: response.hasChildNode,
parentId: response.parent.id,
SSM_id: response.SSM.id,
ext_model_id: response.ext_model_id,
securitySelectionModelName: response.SSM.securitySelectionModelName,
classificationNameNode: response.classificationNameNode.classificationName
};
}
nodes.push(node);
return nodes;
}
}
});