title: Server side pagination using DataTables plugin
body: <p>The server is returning 15 records per page and the total records are over 2000. I'd like to display first 15 records and then on every click of the 'Next' button , display the remaining all records, (15 per page).
  For this do we do a server side pagination or client side???</p>
  
  <p>Here is my table and the attributes I'm using for pagination in <a href="https://datatables.net/" rel="nofollow noreferrer">DataTables</a>:</p>
  
  <pre><code>  var tableData = self.accountCollection.getData();
  
          var tableColumns = this.accountCollection.getColumns();
          var totalRecs = this.accountCollection.length;
  
          //create the UI grid containing the list of items
  
          this.resultsTable = tableEl.dataTable( {
              "bServerSide": true,
              "sEcho": 3,
              "iTotalRecords": totalRecs,
              "iTotalDisplayRecords": 15,
              "aaData": tableData,
              "aoColumns": tableColumns,
              "aaSorting": [[1,'asc']],
             });
  
  
  
  getData: function () {
  
          var returnData = [];
          $.each(this.models, function (idx, accountModel) {
              returnData.push(accountModel.attributes);
          });
          return returnData;
      },
  </code></pre>
  
  <p>The <code>returnData</code> will return me an Object that has fields I will be populating I a table.</p>
  
  <p>Object returned (roughly):</p>
  
  <pre><code>Object
   accountName: "No Company"
   address1: "1234 asdf"
    address2: ""
    billingAcctId: null
    billingSystem: null
    city: "mountain view"
    comments: null
     country: "USA"
  </code></pre>
  
  <p>The getData() function will be then called to return the data from the database using:</p>
  
  <pre><code>var tableData = this.accountCollection.getData()
  </code></pre>
  
  <p>So basically tableData will have the necessary fields and values to display in table. Now I may have more than 1000 records returned from the server. Hence I needed pagination.</p>
  
  <p>The one in fiddle is what I tried and does not have any impact on the paginatin.</p>
  
  <p>I think I have the basic pagination that comes with the DataTables, but now I need to have a server side, to get only 15 records to display at a time, and on click of 'next' and 'prev' button i should be able to make ajax calls to get the remaining records 15 per page.</p>
  
  <p>I hope this helps you understand better. Please let me know if you need more details.</p>
  
  <p>How can I achieve pagination using DataTables?  </p>
  
  <p>Thanks</p>