12AX7 12AX7 - 4 months ago 22
Javascript Question

jQuery Tablesorter - Disable Sort AND Filter

I got this code from http://mottie.github.com/tablesorter/docs/example-options-headers.html:

// BONUS TIP: disable a column using jQuery data directly
// but do it before the table initializes
$("table thead th:eq(5)").data("sorter", false);


This works and I can add a 2nd line as shown below to disable filtering. However, I want to combine them into one line. How would I do that?

// I Want to combine this into the prev line
$("table thead th:eq(5)").data("filter", false);

Answer

TOTALLY UNTESTED but try this

$("table thead th:eq(5), table thead th:eq(7)").data("sorter", false).data("filter", false);