How can I override sorting click event from to inner ?

How can I override sorting click event from to inner ?

ilya_trifonovilya_trifonov Posts: 4Questions: 2Answers: 0

Hi! I need help
I need to override sotring event from <th></th> to custom inner <button></button> or other element
Something like that:

<th>
    <span id="table-title">title</span>
    <button id="sorting-btn">sorting</button>
</th>

Answers

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

    This example from this thread should help, as it's doing code similar to what you want, i.e. separating out elements in that header cell.

    Colin

  • ilya_trifonovilya_trifonov Posts: 4Questions: 2Answers: 0

    Thanks for the answer, Colin.
    I have a complex table header.
    it has a one button with title text and sorting indicators, and other dropdown button. in the dropdown there is a input field for sending a request to the server.
    when I click on any element of the table header, I have a sorting now
    I want to remove the sorting function from the th tag and assign it only to the button with the title.

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

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.