Author Topic: grid option get curPage is always "1"  (Read 3093 times)

maabalaji

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 7
    • View Profile
grid option get curPage is always "1"
« on: July 13, 2015, 02:08:18 am »
some reason get pqgrid option curPage  is always "1"

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6255
    • View Profile
Re: grid option get curPage is always "1"
« Reply #1 on: July 13, 2015, 10:11:04 am »
It's because curPage is a property of pageModel and not of dataModel.

http://paramquery.com/pro/upgrade/Index24

http://paramquery.com/pro/api#option-pageModel

maabalaji

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: grid option get curPage is always "1"
« Reply #2 on: July 13, 2015, 11:51:40 pm »
I think document need to be update, it said dataModel.curPage instead of pageModel.

 Get or set the pageModel > curPage option, after initialization:
   
//getter
var curPage=$( ".selector" ).pqGrid( "option", "dataModel.curPage" );
 
//setter
$( ".selector" ).pqGrid( "option", "pageModel.curPage", 2 );