Infinite server calls(Keno Grid) when using datasource.page

1 Answer 16 Views
Data Source Grid
vc
Top achievements
Rank 1
vc asked on 10 Dec 2021, 04:14 AM | edited on 13 Dec 2021, 05:43 AM

Dear team,

we are using kendo grid, with  server pagination.In one of our senario we need to move last page in programatically,for this we are using dataSource.page(pagenumber) in databound function it is moving fine also,but it is calling sever actions infinitly,Please suggest the way to resolve the issue

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 14 Dec 2021, 12:54 PM

Hello, 

Calling the page method triggers the dataBound event, and as the method is called in that event, the result is the error you are experiencing. I would advise calling the page method in another event, or have a flag so that the method would be called only once in the dataBound event. Please refer to the code below:

dataBound:function(e){
          if(!isDataBound){
            isDataBound = true;
            e.sender.dataSource.page(3);
          }
},
Here is a small example for reference.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Data Source Grid
Asked by
vc
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or