Author Topic: Trouble or mis understanding with sortType  (Read 1547 times)

NearEarthObject

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 30
    • View Profile
Trouble or mis understanding with sortType
« on: May 04, 2020, 11:42:04 am »
Hi !
I have two columns, one dataType integer hidden, the second is an more elegant extrapolation of the first one, who allow repositioning of some stuff through drag and drop.

The visible column must be sort regarding the hidden one.

first hidden column dataIndx is 'position',
second column visible html dataType dataindx is 'productPosition'

I am pretty sure that the solution is super simple but I have been trying many different option without any success.

I cannot use render for the visible column, cause some required information are enclosed in "data attribute" in the html build process for ajax purpose on move node process.

Would you be kind to give me clue to achieve something who intellectually seems simple,  but who belongs to me a brain teaser :)

Thanks for your support

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6210
    • View Profile
Re: Trouble or mis understanding with sortType
« Reply #1 on: May 04, 2020, 11:57:00 am »
you might have to use custom sorting for productPosition column.

https://paramquery.com/pro/api#option-column-sortType

{ dataIndx: "productPosition", sortType: function(rowData1, rowData2){
        //compare rowData1[ 'position' ] and rowData2[ 'position' ]
}}