asp.net グリッドビューのすべてのページでチェックされているチェックボックスの数を示すステータス ラインを即座に更新したいと考えています。現在、現在のグリッドビュー ページでチェックされているチェックボックスの数を数えることしかできません。
これが私のコードです:
$(document).ready(initAll);
function initAll(){
countChecked();
$(".activeBoxes").click(countChecked);
}
function countChecked() {
var n = $(".activeBoxes input:checked").length;
$("#checkboxStatus").text(n + (n == 1 ? " vehicle is" : " vehicles are") + " selected on this page. ");
if( n == 0){
$(".activateButton").hide();
$("#checkboxStatus").hide();
}else{
$("#checkboxStatus").show();
$(".activateButton").show();
}
}