How to bind child elements on the click of parent row in MVC

2 posts, 0 answers
  1. Diwakar
    Diwakar avatar
    2 posts
    Member since:
    Jan 2015

    Posted 27 Jan 2015 Link to this post

    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?
  2. Alex Gyoshev
    Alex Gyoshev avatar
    2527 posts

    Posted 27 Jan 2015 Link to this post

    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 = $("tr");
        var treelist = row.closest(kendo.roleSelector("treelist")).data("kendoTreeList");
        if (treelist && row.length) {

    Alex Gyoshev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top