I want to show a Kendo Treelist on my page without any child elements.
But when I click on any row, an ajax call has to be made to fetch the data and the row should expand with the child elements under it.
How can it be achieved?
1 Answer, 1 is accepted
0
Alex Gyoshev
Telerik team
answered on 27 Jan 2015, 01:22 PM
Hello Diwakar,
I believe you are looking for the remote data loading scenario. If you want to handle clicks on the entire row, you can call the expandRow method via a jQuery event handler on the .k-grid-content tr elements:
$("body").on("click", ".k-grid-content tr", function(e) { var row = $(e.target).closest("tr"); var treelist = row.closest(kendo.roleSelector("treelist")).data("kendoTreeList"); if (treelist && row.length) { treelist.expand(row); } });
Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!