components icon indicating copy to clipboard operation
components copied to clipboard

[SL-GRID] ability to sort filter options

Open fransdeboer opened this issue 1 year ago โ€ข 0 comments

Provide a general summary of the issue here

filter options in an sl-grid are sorted alphabetically. But this behavior is not always desired. In the screenshot below the locations should be sorted on a sequence number rather than alphabet.

image

๐Ÿค” Expected Behavior?

๐Ÿ˜ฏ Current Behavior

๐Ÿ’ Possible Solution

maybe it is possible to add a sort function to the filter options to ColumnDefinition

  {
    id: 'unitName',
    path: 'unitName',
    label: msg('Location'),
    filter: {
      mode: 'select',
      sort: (a, b) => a.sequenceNumber - b.sequenceNumber)
    }
}

๐Ÿ–ฅ๏ธ Steps to Reproduce

What browsers are you seeing the problem on? (only for bugs in code)

Chrome

If other, please specify.

No response

What operating system are you using?

WSL

๐Ÿ‘ค Your name

Frans de Boer

๐Ÿงข Your product/team

Magister

๐ŸŽจ Your Theme(s)

Magister

fransdeboer avatar Sep 20 '24 08:09 fransdeboer