I have a table with the tablesorter js applied. In two of my table header columns I have checkboxes that check yes or no on all of the rows. The issue is that since I have the tablesorter js on the table it will select or deselect all of the rows but then sort them. I want the to only select or deselect all of the checkboxes and NOT sort the columns when click on the checkbox. But when I click in the TH I still want to sort it.
In the rows there is a number next to the checkbox so that is the reason for the keeping the sorting on the columns.
I have tried adding stopPropogation and preventDefault but this has not been any luck.
Here is my JS:
$(".tablesorter")
.tablesorter({
theme: 'blue',
cssInfoBlock: "tablesorter-no-sort",
cssChildRow: "tablesorter-childRow"
});
$("#UseSuggestedSelectAll").change(function(event) {
event.stopPropogation();
if ($(this).is(":checked")) {
$(".suggested").prop('checked', true);
$(".override").prop('checked', false);
$("#OverrrideSelectAll").prop('checked', false);
UpdateTable();
} else {
$(".suggested").prop('checked', false);
UpdateTable();
}
});
I am not positive but maybe it is sorting first and that is why the stopPropogation is not working? Any suggestions?
Aucun commentaire:
Enregistrer un commentaire