How to hide check all, clear all checkbox
<p>I am having check box in the column header. The function of this is to check or uncheck all the check boxes in that column.If the row check box is checked and say delete, that row can be deleted from the dataTable.</p>

<p>If the row object is used in some other table as a foreign key i put '-' in that row instead of check box which indicates that row cannot be deletable.</p>

<p>In these cases if all the row has '-" , there is no need to have the header check box. How to programatically hide this 'Check All | Clear All' check box, if there is nothing to be removed.</p>

<p>It would be even preferable to hide the 'Remove' button if there is no selection to be made.</p>

<p>What are the best practices to address the above scenario. I have attached the javascript which I am using.</p>

<pre><code>&lt;script type="text/javascript"&gt;
var tableId = '#user\\:userList';
jQuery(document).ready(function() {
    jQuery('#selectAll').click(function() {
        jQuery(tableId).find("input[type='checkbox']").attr('checked', jQuery('#selectAll').is(':checked'));
    });
});
&lt;/script&gt;
</code></pre>
