私は子要素をth
のポップアップウィンドウに持っています。 .show_history
divをクリックして、ポップアップdiv .show_history_ctn
を表示すると、その列の並べ替えがトリガーされます。私は.show_history
のZ-インデックスを9999に上げていますが、まだソートがトリガーされています。また、stopPropagationを.show_history
clickイベントに追加しても、ソートが発生します。jQuery tablesorter子要素th並べ替えを無効にする
jQueryの
$(".show_history").on("click",function(event) {
$(this).siblings(".show_history_ctn").find("tr").show();
event.stopPropagation();
if($(this).hasClass("active")) {
$(this).siblings(".show_history_ctn").slideUp();
$(this).removeClass("active");
} else {
$(".show_history_ctn").hide();
$(".show_history").removeClass("active");
$(this).siblings(".show_history_ctn").slideDown();
$(this).addClass("active");
}
});
$(".tablesorter").tablesorter();
HTML
<table class='tablesorter'><thead><tr><th><div class='show_history'>Show History</div><div class='show_history_ctn' style='display:none'>**content**</div></th><th></th></tr></thead></table>
どうすれば解決するのですか?それ以外の場合は、私はちょうどsorter:'false'
を追加したいの列をソートする必要があります。
デモを試みましたが、ポップアップリンクをクリックしても無視され、列がソートされました。 – mdnba50
おっと、ごめんなさい...私は私の答えを更新しました。 – Mottie