This is a migrated thread and some comments may be shown as answers.

Expand all rows - progress

3 Answers 312 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert Madrian
Top achievements
Rank 1
Veteran
Iron
Robert Madrian asked on 10 Feb 2017, 09:43 AM

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);

3 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 13 Feb 2017, 02:55 PM
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.
0
David
Top achievements
Rank 1
answered on 21 May 2017, 09:56 PM

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?

0
Tsvetina
Telerik team
answered on 23 May 2017, 01:53 PM
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.
Tags
Grid
Asked by
Robert Madrian
Top achievements
Rank 1
Veteran
Iron
Answers by
Tsvetina
Telerik team
David
Top achievements
Rank 1
Share this question
or