Options in header filter of datatable sorted alphabetically, not by id

Here’s the snippet reproducing the issue.

In a regular multiselect element, its options are sorted by their id. However, in the header section of a datatable, the filter ignores ids and instead sorts values alphabetically. Is there a way to prevent that from happening?

Good day @hinatoy,

You can use getFilter() method for column ‘architecture’ to returns the filter object. Then return the view list from object by using getList(). And sort the list in the way you needed: sort((a,b)=>a.id-b.id).

Please, note that you should sort list in 'ready’.

Please, check out the snippet with example: Code Snippet

1 Like

Thank you very much!

1 Like