Author Topic: saveState not saving multiple levels of sorting  (Read 2414 times)

ralph1996

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 80
    • View Profile
saveState not saving multiple levels of sorting
« on: November 18, 2016, 10:57:09 pm »
Using ParamQuery Pro 3.3.  When saving the state using saveState if the grid has more than one column selected for sorting, only the first sort column is saved. 

After restoring the state using grid.loadState( {state: state, refresh: false}) we are calling grid.sort() with no parameters to sort based on the sorter information in the grid. 

Thank you!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: saveState not saving multiple levels of sorting
« Reply #1 on: November 20, 2016, 11:58:23 am »
multiKey should be set to null and single to false in order to restore multiple sorting on columns.

Code: [Select]
  sortModel: {single: false, multiKey: null},

ralph1996

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 80
    • View Profile
Re: saveState not saving multiple levels of sorting
« Reply #2 on: November 23, 2016, 10:53:33 pm »
Thanks - that works.  It is odd though that doing this still requires holding the shift key for multi-sort yet the documentation says it woudl nto require this.  THat would be an issue for us as we want the shift key to be required.  But I guess we coudl do the restore of the sort order and then set multiKey to the shift key after the fact.