How can I get all the children for selected row in kendo ui treelist :
I want to get direct children for Backframe
that would be level 3 rows.
How can I get all the children for selected row in kendo ui treelist :
I want to get direct children for Backframe
that would be level 3 rows.
TreeList has dataSource.childNodes method for this purpose.
change: function(e) {
var selectedRows = this.select();
if (selectedRows.length > 0){
var dataItem = this.dataItem(selectedRows[0]);
var children=this.dataSource.childNodes(dataItem);
console.log(children);
}
}
You need to iterate through the datasource comparing the id of the row to the parentid of each row: