Modifying table headers

Modifying table headers

drobertsdroberts Posts: 2Questions: 1Answers: 0

Good morning,

I am hoping I can find some help here. I am replacing the DataTables header with a search dropdown on the left, and the table header (and sort order indicator) on the right. At the moment, when we click the search button, the order function is called, and we want to disable this functionality, and only have the ordering happen when the header text (or order indicator) is clicked.

Below is what my header looks like with the search icon and other parts, as described

Image of Header

Answers

  • kthorngrenkthorngren Posts: 22,015Questions: 26Answers: 5,081
    edited May 7

    Likely you can use stopPropagation() in the event handler as shown in this example of this thread. Or you can use two header rows. An example of this is also in the thread.

    Kevin

  • drobertsdroberts Posts: 2Questions: 1Answers: 0

    Apologies for the late reply, this worked perfectly.

    I am going to be honest. When you work "professionally" on JS and TS and then realise you forgot about stoppropagation(), you probably need to have a good, long word with yourself!

  • allanallan Posts: 64,519Questions: 1Answers: 10,664 Site admin

    Meh - its easy done. We all do it I'm sure :)

    Good to hear it is working for you now.

    Allan

Sign In or Register to comment.