Hi,
Just a follow-up question regarding the display of values in the filter. Currently, the values are listed in alphabetical order. We have a requirement for one of the filters to display the values in a custom order (based on the most frequently used values.. assuming each value has a weight assigned, we would fix a higher weightage for certain values which always show at the top).
Can you please recommend the best way to achieve this functionality?
Warm Regards,
Akshay
Hi, Akshay!
Thank you for your question.
There are two ways you can implement custom sorting in Flexmonster:
1. You can specify sortOrder
property with values in an order predefined by you.
rows: [ { uniqueName: "Category", sortOrder: ["Bikes", "Cars", "Clothing", "Accessories", "Components"] } ],
2. You can set a sorting function with sortingMethod
API call.
flexmonster.sortingMethod("Category", function (a, b) { return a < b ? 1 : -1; });
Please refer to our documentation for more details on custom sorting:
https://www.flexmonster.com/doc/sorting/
We hope it helps. Please let us know if any questions arise.
Best Regards,
Maksym