我在this fiddle中有一个带有复选框和下拉选择器的jquery数据表。我将选中的复选框计为,
function updateCount () {
count = $("input[name='check']:checked").length;
agebelow = $(".AgeSelect option:selected[name='below']").length;
ageabove = $(".AgeSelect option:selected[name='above']").length;
$("#count").text(count);
if (count > 0) {
$("#status").toggle(count > 0);
}
$('#count2').text(agebelow);
if ( agebelow > 0 ) {
$("#status2").toggle(agebelow > 0);
}
$('#count1').text(ageabove);
if ( ageabove > 0 ) {
$("#status1").toggle(ageabove > 0);
}
};
计数器在数据表的第一页正常工作。但在其他页面中,当我选中复选框时,计数器不会更新。同样适用于下拉列表。那么我该如何解决这个问题呢?