Make my tables headers (th) not clickable. (sort-able)

Make my tables headers (th) not clickable. (sort-able)

jim54729jim54729 Posts: 7Questions: 3Answers: 0

https://jsfiddle.net/jim54729/5k7pgzce/

I am not able to insert an unbind function into my code.
$('#mymatrixTable thead th').unbind('click');
Mostly lack of being able to modify that code to fit in what i already have issue.

I do not want the user to sort by column, only use the search boxes to filter out unwanted rows.

The score column will be hidden once it works.

I want all returned data to always sort by score. so if a user types in "tree", in one search box, then "AZ" in the other search box, i want the last 3 results to be in order by score. (Market_Co_Score). As it is working now, once you click in the State Search box to type in "AZ" the re-orders it self.

Thank you in advance.

This question has an accepted answers - jump to answer

Answers

  • jim54729jim54729 Posts: 7Questions: 3Answers: 0

    the data is pulled from a database with asp classic.

  • kthorngrenkthorngren Posts: 21,352Questions: 26Answers: 4,955
    edited May 2018 Answer ✓

    You can use columns.orderable to disable the users ability to order the table. The following will disable this capability for all columns:

          "columnDefs": [
            { "orderable": false, "targets": "_all" }
          ]
    

    But your default ordering will take place.

    Kevin

  • jim54729jim54729 Posts: 7Questions: 3Answers: 0

    This is perfect. now i can search by the search boxes, and all results are in order by score. Thanks Kevin. Spent too much time trying to do this on my own. (too embarrassed to tell you how much.). Thanks alot

This discussion has been closed.