Author Topic: SortType parameters  (Read 336 times)

entwine.llc.wi

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 14
  • Consultant
    • View Profile
SortType parameters
« on: June 25, 2022, 01:24:41 am »
What is the most efficient way to pass datatype and sort direction to the sortType function? 

These two pieces of information would be quite useful in a project I am working on.

Thanks

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: SortType parameters
« Reply #1 on: June 27, 2022, 06:17:35 am »
dataType and sort direction parameters are not passed to sortType function.

However they can be obtained with this code inside the sortType callback function.

Code: [Select]
var dataType = grid.getColumn({dataIndx: dataIndx}).dataType || "string";
var dir = grid.option('sortModel').sorter.find(col=>col.dataIndx==dataIndx).dir

where grid is js grid instance of the grid.