title: How to add page length in datatables when using ajax implementation
body: <p>I'm trying to add pageLength to my datatables with ajax implementation but when I try to see the results, it returns a lot on the table instead of slicing the data for each page. Please see my code below.</p>
  <p><strong>JS</strong></p>
  <pre><code>$('table.dataTableAjax').DataTable({
    &quot;processing&quot;: true,
    &quot;serverSide&quot;: true,
    &quot;paging&quot;: true,
    &quot;pageLength&quot;: 50,
    &quot;ajax&quot;: &quot;...&quot;
  });
  </code></pre>
  <p>I also tried the code below but still not working fine.</p>
  <pre><code>&quot;lengthMenu&quot;: [[10, 25, 50, -1], [10, 25, 50, &quot;All&quot;]]
  </code></pre>
  <p><strong>Example Data From Server Side</strong></p>
  <pre><code>{
      &quot;data&quot;:[
          { &quot;name&quot;: &quot;Bob&quot; },
          { &quot;name&quot;: &quot;Billy&quot; }
      ]
  }
  </code></pre>
  <p>In my server side, I'm throwing about 500+ data rows.</p>
  <p>So the current result is it returns all the 500+ table rows instead of 50 table rows each page.</p>