Author Topic: sortModel not showing sort indicator when type is remote  (Read 3977 times)

Webauthor

  • Pro OEM
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
sortModel not showing sort indicator when type is remote
« on: October 15, 2016, 07:24:34 am »
Hi, when setting an initial sort e.g.

sortModel: {"cancel":false,"sorter":[{"dataIndx":"Activity_ToDate","dir":"down"}],"type":"remote","on":true}

The sorting indicator is not visible

e.g.
https://martin-dev.samis.io/go/view/pq-grid-test.cfm

If I change type="local" it shows the triangle, but of course the sorting is not working because it needs to be remote.

Can you please take a look?

Thanks

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: sortModel not showing sort indicator when type is remote
« Reply #1 on: October 15, 2016, 09:52:00 am »
I could see the issue at your mentioned url but unable to reproduce the issue at my end with the remote sorting example: http://paramquery.com/pro/demos/sorting_remote with similar sortModel options.

Can you please share an isolated test case/ jsfiddle.

Webauthor

  • Pro OEM
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Re: sortModel not showing sort indicator when type is remote
« Reply #2 on: October 21, 2016, 03:39:39 am »
Hi, isn't what I gave you a standalone? 

Do you have a base JSFiddle I can use to then add my unique code?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: sortModel not showing sort indicator when type is remote
« Reply #3 on: October 21, 2016, 09:04:47 am »
Sorry by standalone I mean only pqgrid related files in the document.

Please use this as base jsfiddle: http://jsfiddle.net/5yg81u60/ or if you can send it as an attachment, that would also do.
« Last Edit: October 21, 2016, 09:15:35 am by paramquery »

Webauthor

  • Pro OEM
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Re: sortModel not showing sort indicator when type is remote
« Reply #4 on: October 21, 2016, 10:32:04 am »
Ahh, I found the issue.

If you look at the same example you gave me.
http://paramquery.com/pro/demos/sorting_remote

and replace line 21:

url: "/pro/orders/get" //for ASP.NET

with:

getUrl: function(ui) {return {url:"/pro/orders/get",data:{}}}

You will see the issue in place.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: sortModel not showing sort indicator when type is remote
« Reply #5 on: October 24, 2016, 07:39:16 am »
Thanks got it.

Please use the dataModel.url option to specify url

and

use dataModel.postData option to send any extra parameters to remote scripts.

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