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

kendo-grid, angularjs progress loading on initialization

8 Answers 613 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Enrico
Top achievements
Rank 1
Enrico asked on 20 Oct 2014, 11:05 AM
Hi,

I'm using kendo grid in angularjs and it works great so far. There is only one limitation that I've found: the grid does not show the progress loading when binding the first time to a remote service.

I'm initializing the DataSource form a controller and assigning it to a $scope variable, then binding the variable to k-data-source attribute in the HTML.

The only way I found to achieve that behavior is to do something dirty during the datasource initialization, like:

                        requestStart: function (e) {
                            kendo.ui.progress($('[kendo-grid]'), true);
                        },
                        requestEnd: function (e) {
                            kendo.ui.progress($('[kendo-grid]'), false);
                        }

Do you have any suggestion?

Thanks,
Enrico

8 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 22 Oct 2014, 07:43 AM
Hello Enrico,

The grid should display the progress loading without this extra code. Here is a demo which shows the same. What is different in your case?

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrico
Top achievements
Rank 1
answered on 22 Oct 2014, 07:59 AM
Hi,

I was able to reproduce that behavior: http://dojo.telerik.com/Ifef/3

I use to assign k-data-source and k-options (plus k-rebind) in two separate variables, because I'm having a gridOptions in a MainCtrl which is inherited in sub controllers.

Can you check this scenario?

Thanks,
Enrico
0
Mihai
Telerik team
answered on 23 Oct 2014, 08:15 AM
Hi Enrico,

I can reproduce the same behavior without Angular: http://dojo.telerik.com/UBAWI -- the progress does not initially show.  However, it shows up when the grid has a defined height, here I added style="height: 300px" to the <div>: http://dojo.telerik.com/UBAWI/2

The same happens with the Angular version, if I add the height then the progress veil shows up: http://dojo.telerik.com/Ifef/4

Another way is to pass i.e. height: 300 via the grid options, as the example from Atanas does.

Regards,
Mihai
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrico
Top achievements
Rank 1
answered on 23 Oct 2014, 08:33 AM
If I define an height it's working, I could even do it this way:

div[kendo-grid] {
    height: 300px;
}

but a fixed height isn't so nice because the grid is fixed and if you change the pagination this will remain 300px and you have to scroll down the div.

If I set a min-height it does not work. Is there a way to set an initial height just for displaying the loader and then leave it auto? This will be a good solution form me.

Thanks,
Enrico
0
Atanas Korchev
Telerik team
answered on 23 Oct 2014, 01:38 PM
Hello Enrico,

The only way to remove the height of the grid after it loads is via jQuery. Here is how: http://dojo.telerik.com/@korchev/exuso

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrico
Top achievements
Rank 1
answered on 23 Oct 2014, 01:50 PM
Unfortunately I have scrollable: true and in that case it does not work.

http://dojo.telerik.com/eCIlE

Enrico
0
Accepted
Atanas Korchev
Telerik team
answered on 24 Oct 2014, 07:41 AM
Hello Enrico,

In that case check this demo: http://dojo.telerik.com/@korchev/exuso

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrico
Top achievements
Rank 1
answered on 24 Oct 2014, 10:21 AM
Hi,

OK this trick seems to work.

Thank you,
Enrico
Tags
Grid
Asked by
Enrico
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Enrico
Top achievements
Rank 1
Mihai
Telerik team
Share this question
or