Author Topic: change sort type dynamically  (Read 1818 times)

msdnweixiao

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 21
    • View Profile
change sort type dynamically
« on: January 07, 2021, 01:30:56 pm »
hello,
When the table is initialized, the sort type is remote.
After inserting the local data, how can I change the sort type to local?

Note: Use sort method to change sortModel options dynamically.
But the sort method does not modify the type parameter.

thank you.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile
Re: change sort type dynamically
« Reply #1 on: January 07, 2021, 10:39:23 pm »
you are right, it can't be done with sort method.

generic option method can be used for it.

Code: [Select]
  grid.option('sortModel.type', 'local');

msdnweixiao

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: change sort type dynamically
« Reply #2 on: January 08, 2021, 08:04:05 am »
OK, it works.

But when sorting Chinese characters, the order of sorting is not correct. How to customize sorting rules for a column?

thank you

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile
Re: change sort type dynamically
« Reply #3 on: January 08, 2021, 06:16:28 pm »

msdnweixiao

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: change sort type dynamically
« Reply #4 on: January 09, 2021, 09:00:50 am »
yes, thank you.