//全选
$('#selectall').click(function() {
$('.selectcontrol[type=checkbox]').prop('checked', true).change();
})
//全不选
$('#selectallno').click(function() {
$('.selectcontrol[type=checkbox]').prop('checked', false).change()
})
//反选
$('#selectreverse').click(function() {
$('.selectcontrol[type=checkbox]').prop('checked', function() {
return !$(this).prop('checked')
}).change()
})
checkbox属性disable是true的情况下,全选: 可用value值区分disable为true的元素
//全选
$('.checkall').click(function() {
$(this).parents("#main_table").find(".checkelement").each(function() {
if (this.value!="1") {
$(this).attr("checked", true).change();
}
});
});
//反选
$('.checkreverse').click(function() {
$(this).parents("#main_table").find(".checkelement").each(function() {
if (this.value!="1") {
$(this).attr("checked", function() {
return !$(this).prop('checked')
}).change();
}
});
})