ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: msdnweixiao on January 07, 2021, 01:30:56 pm

Title: change sort type dynamically
Post by: msdnweixiao 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.
Title: Re: change sort type dynamically
Post by: paramvir 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');
Title: Re: change sort type dynamically
Post by: msdnweixiao 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
Title: Re: change sort type dynamically
Post by: paramvir on January 08, 2021, 06:16:28 pm
Sorting can be customized with column.sortType callback.

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

Example: https://paramquery.com/pro/demos/sorting_custom
Title: Re: change sort type dynamically
Post by: msdnweixiao on January 09, 2021, 09:00:50 am
yes, thank you.