Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get selected page number in kendo grid

Hi i'm very much new to kendo UI, so need help in the below fix,

I'm using kendo grid UI as below for pagination: <script> $(document).ready(function(){ $("#table3").kendoGrid({ dataSource: { pageSize: 10 }, pageable: true, enter code hereheight: 300, sortable: true, }); $("#table3").show(); }); </script>

when user edits a record in a page, he's redirected to edit page with that record details so I need current page number because after editing a record in a page, I need to redirect user to the same page after saving the details of that record. I'm using this in a coldfusion page. Please help.

Thanks in advance

like image 383
Rajni Avatar asked Jun 24 '13 07:06

Rajni


1 Answers

What you are after is here :

http://docs.kendoui.com/api/web/pager#methods-page

 // get the page
 var currentPage = grid.dataSource.page();

 // later set the page
 grid.dataSource.page(currentPage );

But I am bit confused with the redirect from the grid to edit page, why do you do that ? Kendo has inline batch edit and popup edit features, if you move to other page it will all get bit more complicated.

FYI : http://demos.kendoui.com/web/grid/editing.html

like image 179
Vojtiik Avatar answered Jan 02 '23 00:01

Vojtiik