Javascript 带有(全选)复选框和表排序器的TH元素

Javascript 带有(全选)复选框和表排序器的TH元素,javascript,jquery,sorting,checkbox,tablesorter,Javascript,Jquery,Sorting,Checkbox,Tablesorter,我有一个应用了tablesorter js的表。在我的两个表头列中,我有复选框,在所有行上都选中是或否。问题是,由于表上有TableSorterJS,它将选择或取消选择所有行,然后对它们进行排序。我希望在单击复选框时只选择或取消选择所有复选框,而不对列进行排序。但是当我点击TH时,我仍然想对它进行排序 在行中,复选框旁边有一个数字,这就是保持列排序的原因 我曾尝试添加StopRopogation和preventDefault,但这并不是什么好运气 这是我的JS: $(".tablesorter"

我有一个应用了tablesorter js的表。在我的两个表头列中,我有复选框,在所有行上都选中是或否。问题是,由于表上有TableSorterJS,它将选择或取消选择所有行,然后对它们进行排序。我希望在单击复选框时只选择或取消选择所有复选框,而不对列进行排序。但是当我点击TH时,我仍然想对它进行排序

在行中,复选框旁边有一个数字,这就是保持列排序的原因

我曾尝试添加StopRopogation和preventDefault,但这并不是什么好运气

这是我的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();
            }
        });
下面是我的一个TH的样子(渲染为丑陋):


使用建议数量

我不是肯定的,但可能是排序第一,这就是为什么stopPropogation不起作用?有什么建议吗?

你能分享你的HTML吗?或者最好是演示一下这个问题?你看到了吗?您可以将第11行上的
resort
值更改为
false
,以防止重设。
<th id="suggested-header" style="width: 160px; vertical-align: middle; -webkit-user-select: none;" class="sort-text tablesorter-header tablesorter-headerUnSorted" data-column="0" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="stock-item-table" unselectable="on" aria-sort="none" aria-label="

                                    Use Suggested Qty
                                : No sort applied, activate to apply a descending sort"><div class="tablesorter-header-inner">
                                    <input id="UseSuggestedSelectAll" name="UseSuggestedSelectAll" style="vertical-align: bottom;float:right;" type="checkbox" value="true"><input name="UseSuggestedSelectAll" type="hidden" value="false">
                                    <label for="Use_Suggested_Qty" style="margin-top:6px;margin-right: 5px;float:right;">Use Suggested Qty</label>
                                </div></th>