Expand all rows - progress

4 posts, 1 answers
  1. Robert Madrian
    Robert Madrian avatar
    152 posts
    Member since:
    Apr 2003

    Posted 10 Feb Link to this post

    Hi,

    I use the following Code "grid.expandRow(grid.tbody.find("tr.k-master-row"));" to expand all rows and it works but it takes some time ( a few seconds)

    so I thought I use kendo.ui.progress to show the grid progress indicator during the expansion - but this doesn't work...
    what I'm doing wrong?
    how to show the progress indicator from/in the grid if a longer progress is taken place?
    robert

    var grid = $("#grdStandort").data("kendoGrid");
    kendo.ui.progress($("#grdStandort"), true);
    grid.expandRow(grid.tbody.find("tr.k-master-row"));
    kendo.ui.progress($("#grdStandort"), false);
  2. Answer
    Tsvetina
    Admin
    Tsvetina avatar
    2029 posts

    Posted 13 Feb Link to this post

    Hello Robert,

    There is probably some internal logic running at this point, for example the Grid data-binding that, upon finish, hides the progress indicator internally.
    What you can try is to show progress and call the expandRow method in the Grid dataBound event. Then, hide the progress in the detailExpand event of the Grid if the number of expanded rows equals the total number of rows.
    You can see a Dojo demonstrating this approach here: http://dojo.telerik.com/@tsveti/uJorAM/8.

    Regards,
    Tsvetina
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. David
    David avatar
    19 posts
    Member since:
    Jun 2015

    Posted 21 May Link to this post

    Hi Tsvetina.  I have the same problem for a kendo hierarchical grid that is more than two levels deep.  The approach outlined above will not work as the count of the master rows changes as each level is expanded.

    Is there an alternative way to show progress while all the levels are being expanded programatically?

  4. Tsvetina
    Admin
    Tsvetina avatar
    2029 posts

    Posted 23 May Link to this post

    Hi David,

    Do you mean that the code does not work for you because there are master/detail rows on the second level of the Grid too? If so, you can make sure that you are querying the rows from the parent Grid only, for example:
    detailExpand: function(e) {
      var expandedRowsLength = $('.k-detail-row:visible', e.sender.element).length,
          allRowsLength = $('.k-master-row', e.sender.element).length;
     
      if(expandedRowsLength==allRowsLength){
          kendo.ui.progress($("#grid"), false);
      }
    },

    If this does not work, please share a Dojo, which demonstrates the exact problem.

    Regards,
    Tsvetina
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top