I am using angular + kendo ui. I have created a tree and added first node as dummy
$scope.treeData = kendo.observableHierarchy({
data: [{ text: "" ,items: [] }]
});
after that when I have the right data , I want to place the right data
function init() {
var query = CSensorGroupRepositoryService.getQueyObject().where("ParentID", "==", 0); // groups with no parent
CSensorGroupRepositoryService.getEntitiesByQuery(query).then(function (results) {
var parent = { text: results[0].GroupName, items: [] };
buildTreeHierarchy(results[0], parent);
$scope.treeData[0].text = results[0].GroupName;
});
}
how ever in the view - the text is empty
Use ObservableObject.set
so the change event is triggered and your widget updates its view:
$scope.treeData[0].set("text", results[0].GroupName);