bind default sorting function to part of the cell

bind default sorting function to part of the cell

isaacdvoryisaacdvory Posts: 5Questions: 2Answers: 0

Hi,

So I'm using column filtering and want to enable sort, but I made a change to the filtering, I move the filter to the first row, without cloning it, see picture attached.
My problem now is that whenever I click in the input box, it also sorts the table, how can I change that behavior?

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    You can use orderCellsTop for that,

    Colin

  • isaacdvoryisaacdvory Posts: 5Questions: 2Answers: 0
    edited July 2020

    Thanks colin, I'm not sure that's what I need.
    this function seems to accept true and false only, what I'm looking to do is leave the sort on the top cells but have the "click" bind, limited to the arrow keys and not for the whole cell

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923

    The recommended approach is to use two headers; one for sorting and the other for searching. See this thread for examples of both text input and select searches. The use orderCellsTop as Colin mentioned.

    Kevin

  • isaacdvoryisaacdvory Posts: 5Questions: 2Answers: 0

    so there is no supported way to do what I want?

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923
    edited July 2020

    The order listener attaches to the th element. There is not a built-in way to attach only to the sorting arrows - which is what I think you are asking for. It should be possible for you to attach your own listeners to the area you want and use the order() API to perform the ordering.

    Kevin

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923

    Also see this thread asking a similar question.

    Kevin

This discussion has been closed.