Author Topic: pq_curpage with other name for Apigility  (Read 1986 times)

emontes

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 8
    • View Profile
pq_curpage with other name for Apigility
« on: April 20, 2016, 06:28:12 pm »
I'm using apigility with pqGrid, but when I send the current page pqGrid send it as pq_curpage and apigility expects this parameter to be called only "page".

Is there a way to rename this pq_page to page?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: pq_curpage with other name for Apigility
« Reply #1 on: April 20, 2016, 10:19:58 pm »
The parameters send by grid can be changed / renamed in dataModel.beforeSend callback.

Code: [Select]
beforeSend: function(a, b){

if(b.type == "POST"){
b.data = b.data.replace("pq_curpage", "page");
}
else{
b.url = b.url.replace("pq_curpage", "page");
}
},

http://paramquery.com/pro/api#option-dataModel-beforeSend
« Last Edit: April 20, 2016, 10:21:40 pm by paramquery »