Jquery DataTable keeps going back to first page when changing the checked status of checkboxes in other pages with javascript
<p>I have the following code</p>

<pre><code>    $('input[name="select-all"]').click(function() {
     //channel-data is initialised as DataTable
     $('#channel-table').find('input[name="batch-select"]:checked').each(function () {
        $(this).prop("checked",true);
    });
});
</code></pre>

<p>whenever I click the select all button in any page other than 1st The datatable keeps reverting back to the first page.
I  think it happens because of redraw due to change in checkboxes property.Any work around this?</p>