jQuery tablesorter + tablefilter and dsiable some table header sorting
I have the following Javascript, it's not working the way I want it to. I want to disable sort开发者_StackOverflowing with some header. The problem is when I put the first function to disable the some header, it makes other header one-way sortable only, though they should be two sortable.
$(document).ready(function() {
$("#TimeSheet").tablesorter({
// pass the headers argument and assing a object
headers: {
// assign the secound column (we start counting zero)
1: {
// disable it by setting the property sorter to false
sorter: false
},
// assign the third column (we start counting zero)
2: {
// disable it by setting the property sorter to false
sorter: false
}
}
});
$("#TimeSheet").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
.tablesorterFilter({ filterContainer: $("#filterBox"),
filterClearContainer: $("#filterClear"),
filterColumns: [0, 1],
filterCaseSensitive: false
});
});
It's not good to call tablesorter two time just disable some headers, also the other header can be sorted only one way not two ways any more. I think it's because of the first function that disables some header. I'm trying to disable some header in the second function but I can't have it worked yet. Any suggestion? Thank you.
FYI:
I just figured it out, please take a look at the following :
$("#TimeSheet").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'], headers: {8:{sorter: false }} })
.tablesorterFilter({ filterContainer: $("#filterBox"),
filterClearContainer: $("#filterClear"),
filterColumns: [0, 1],
filterCaseSensitive: false
});
});
精彩评论