Reputation: 1643
I have an API call which gives result and I am assigning it as kendo tree-view data-source. I get API result quickly but result is too heavy which takes time to build/render kendo tree-view.
So I want to keep a loading icon till it is being rendered. But I do not find any dataBound /widgetRendered event as kendo-grid has.
Check below link for reference. This is how I am creating tree using kendo.data.HierarchicalDataSource().
Any alternative how can I have such events like dataBound or WidgetRendered ?
Thanks in advance.
Upvotes: 0
Views: 1225
Reputation: 11568
For dataBound
Have a look at the DOJO - TreeView Databound with AngularJS I've made.
You can use the same k-options
attribute as there is for kendoGrid
<div kendo-tree-view="tree"
k-data-source="treeData"
k-options="treeOptions">
</div>
In controller
, the k-options
will be having dataBound
function.
$scope.treeOptions = {
checkboxes: {
template: "<input type='checkbox' #= item.disabled # />"
},
template: ' <span style="color: #= item.color #">#= item.text #</span>',
dataBound: function(e){
console.log(e.sender);
//do whatever you want!
}
};
Upvotes: 0