We have a list of days at the top of the table header and we want to disable the Check All capability if the selected day is greater than the current day (e.g. today is 30th, but the select 31st). We will allow checkAll to work for any date less than the current date. How do we achieve this?
<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>