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

Options to reload the grid with always first page

1 Answer 2220 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Raj Yennam
Top achievements
Rank 1
Raj Yennam asked on 21 Apr 2014, 10:01 AM
Hi,

Kendo UI Grid is reloading the data with previously selected page number. If  I moved to 10th page of the Grid and then i am reloading the Grid with recent data. Grid data  is still showing the 10th page  instead of 1'st page. How can i reload the grid with focus on  first page. 

{  
var grid = $("#grid").data("kendoGrid");  
grid.dataSource.page(1);
}
If i placed the above code before reloading, it's taking time to reload the grid.
If i placed the above code after reloading, it's hitting the sever twice.

Please suggest on this.

Thanks,
Raj Yennam

1 Answer, 1 is accepted

Sort by
1
Vladimir Iliev
Telerik team
answered on 23 Apr 2014, 07:35 AM
Hi Raj,

I'm not sure what is the exact scenario that you have, however you can refresh the grid data using directly the "query" method of it's dataSource which will reload the data and change the page with one request:

var grid = $("#grid").data("kendoGrid");
grid.dataSource.query({
     page: 1,
     pageSize: 10
});

Regards,
Vladimir Iliev
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
Raj Yennam
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or