0
我们在表格标题顶部有一个天数列表,如果所选日期大于当天(例如今天是30日,但选择31日),我们希望禁用全部检查功能。我们将允许checkAll在小于当前日期的任何日期工作。我们如何实现这一目标?如何防止未来日期的checkAll选择?
<script type="text/javascript">
jQuery(document).ready(function(){
// This provides selectAll, clearAll capability
jQuery('#records').find('thead th').click(function(){
var ch = jQuery(this).find("input[type='checkbox']").attr('checked');
var col = jQuery(this).prevAll().length;
var ch = jQuery(this).find("input[type='checkbox']").attr('checked');
jQuery('#records').find('tbody td').each(function(){
var tdId = jQuery(this).attr('id');
if(col == tdId) {
if(jQuery(this).hasClass('user-present')) {
// Toggle the value of attribute checked for the checkbox
jQuery(this).find("input[type='checkbox']").attr('checked', true);
}
}
});
});
});
</script>