Hi,
I am trying to get the grid to go back to page one on any sorting or filtering operation (ServerOperation=true) on an ajax enabled grid. I noticed even the samples dont return to page one when sorting - it leaves you right on the same page.
Right now I do this:
and it does a read, but leaves it on the page the user was last at. How do I get this to go back to page 1?
Thank you.
David A
I am trying to get the grid to go back to page one on any sorting or filtering operation (ServerOperation=true) on an ajax enabled grid. I noticed even the samples dont return to page one when sorting - it leaves you right on the same page.
Right now I do this:
$("#clients-grid").data("kendoGrid").dataSource.read()
and it does a read, but leaves it on the page the user was last at. How do I get this to go back to page 1?
Thank you.
David A
7 Answers, 1 is accepted
0
Hello David,
When filtering the grid widget will reset it's page index as the result set will be reduced. However when sorting this is not neccessary as the same page numbers should be available. Sorting does not reduce the result set/data items/.
Regards,
Nikolay Rusev
the Telerik team
When filtering the grid widget will reset it's page index as the result set will be reduced. However when sorting this is not neccessary as the same page numbers should be available. Sorting does not reduce the result set/data items/.
Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

David A.
Top achievements
Rank 1
answered on 20 Dec 2012, 07:48 AM
Thank you for your response Nikolay. I am filtering externally from a search box and want the page index to be reset. If I am on page 3 and perform a datasource.read() which filters the results to 1 page, the grid stays on page 3 and is blank. How can I force the grid to go to page 1?
Thank you.
Thank you.
0
Hello David,
You should use DataSource.filter method in order to reset the page index.
Regards,
Nikolay Rusev
the Telerik team
You should use DataSource.filter method in order to reset the page index.
Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

David A.
Top achievements
Rank 1
answered on 21 Dec 2012, 10:57 PM
Hello Nikolay. Thank you again for your response but I didn't state my question clearly for which I apologize. I have an external field that I am using to narrow the search results on and not using the grid filters. I dug into the js source for grid and this seems to work:
$("#clients-grid").data("kendoGrid").dataSource.page(1);
It must refetch the data behind the scenes.
David A
0
Accepted
Hello David,
To combine several operation such as paging, filtering, grouping etc. within one request you can use the query method.
Kind regards,
Petur Subev
the Telerik team
To combine several operation such as paging, filtering, grouping etc. within one request you can use the query method.
Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

David A.
Top achievements
Rank 1
answered on 26 Dec 2012, 07:19 PM
Thank you Petur. That is exactly what I was looking for.
0

Sivaramakrishna Reddy
Top achievements
Rank 1
Veteran
answered on 31 Mar 2020, 02:53 PM
Thank you. It is working for me.