title: check uncheck All checkboxes not working for all pages when using datatable
body: <p>Script:</p>
  
  <pre><code>$(document).ready(function() {
      $(function(){
          $("#result").dataTable({ 
              "scrollX" : true, 
                  "ordering" : true,
                  "order": [[ 1, "asc" ]],
                  "info" : true, 
                  });
          });  
      $("#all").click(function () { 
          if ($("#all").is(':checked')) {
              $(".checkboxclass").each(function () {
                  $(this).prop("checked", true);
              }); 
          } else {
              $(".checkboxclass").each(function () {
                  $(this).prop("checked", false);
              });
          }
      }); 
  });     
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;table class="tg" id="result" style="width: 100%"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th class="tg" style="text-align: center"&gt;&lt;input type="checkbox" id="all" 
                  onclick="toggle(this);" /&gt;&lt;/th&gt;
          &lt;/tr&gt; 
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr th:each="map : ${listID}"&gt;
              &lt;td class="tg bg" align="center"&gt;&lt;input type="checkbox" class="checkboxclass" name="check"
                  th:id="${map['ID']}" th:value="${map['ID']}" /&gt;&lt;/td&gt;
          &lt;/tr&gt;       
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Checking on one check box selects all but only limited to current page. It is not working for rest of the pages in pagination</p>
  
  <p>Can anyone help on this issue. Thanks.</p>