Author Topic: sortIndx and sortDir in Pro?  (Read 8126 times)

MatsP

  • Pro Economy
  • Newbie
  • *
  • Posts: 12
    • View Profile
sortIndx and sortDir in Pro?
« on: September 19, 2013, 03:54:38 am »
In the Pro version, it seems like the remote sorting as changed.
This used to work in the free version, but now sortIndx and sortDir  are 'undefined'.
getUrl: function () {
   return {
        url: "order.aspx/GetOrderItems",
        data: "{'orderID':19069,'sortColumn':'" + this.sortIndx + "','sortDir':'" + this.sortDir + "'}"
   };

« Last Edit: December 01, 2013, 02:10:12 pm by paramquery »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6323
    • View Profile
Re: sortIndx and sortDir in Pro?
« Reply #1 on: September 19, 2013, 08:07:07 pm »
Mats

this keyword in getUrl no longer points to dataModel

You need to take reference to dataModel from argument to the function.

getUrl: function ( ui ){
   var dataModel = ui.dataModel;
   return {
        url: "order.aspx/GetOrderItems",
        data: "{'orderID':19069,'sortColumn':'" + dataModel.sortIndx + "','sortDir':'" + dataModel.sortDir + "'}"
   };
}

Reference:

http://paramquery.com/api#option-dataModel-getUrl
http://paramquery.com/pro/api#option-dataModel-getUrl