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

[Solved] Set Page / goto Page (JSP)

1 Answer 370 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mathias
Top achievements
Rank 1
Mathias asked on 08 Apr 2015, 06:33 AM

Hey,

 i have a Problem with kendo grid and seting up inital Page.

Initial situation:

I have a Grid with many entries, one of them is the right one. On wich Page this entry is i dont know.

 

What i have tried:

in the databound event i identify the Item(Object) on which page it is (loop over the datasource) after this i want to set the initial page, but if i use dataSource.page(index) javscript shows error -> "too much recursion".Where to set the initial Page?

I'm using JSP and Jquery

Thanks for help.

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 10 Apr 2015, 06:43 AM
Hello Mathias,

This happens because setting the page triggers the dataBound event. You need to add an if statement and avoid paging if the target page is the current one. Here is a code snippet:

dataBound: function() {
     var newPageIndex = calculatePageIndex();

     if ( newPageIndex != this.dataSource.page() ) {
          this.dataSource.page(newPageIndex);
     }
}

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Mathias
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or