title: How to configure DataTables to work with Page Number instead of Start record
body: <p>I have an existing web application that currently uses jqGrid and the entire server-side backend returns paginated info based on Page Number and Page Length. 
  Now I want to start using DataTables on some parts, and since its pagination uses Start record and Length, I want to know if there's some way to configure DataTables to accept Page Number so I don't have to modify my whole backend.</p>
  
  <p>Any way to configure or maybe adapt DataTables for this?</p>
  
  <p>Edit: just to avoid confusion, I'm talking about DataTables with the server-side processing functionality, not about the client-side pagination.</p>
  
  <p>EDIT 2: Adding some code of how my backend takes and responds to the requests from the browser. It's ASP.NET MVC4.</p>
  
  <p>My Services respond always with pages of data of the entity being worked with with a method like this:</p>
  
  <pre><code>Page&lt;T&gt; GetPage&lt;TKey&gt;(int pageNumber,
                        int pageSize,
                        Expression&lt;Func&lt;T, TKey&gt;&gt; orderBy,
                        bool ascending = true,
                        Expression&lt;Func&lt;T, bool&gt;&gt; predicate = null)
  </code></pre>
  
  <p>This will return a <code>Page&lt;T&gt;</code> object like this:</p>
  
  <pre><code>public class Page&lt;T&gt; : IEnumerable&lt;T&gt;
  {
      private readonly IList&lt;T&gt; _items;
  
      public IList&lt;T&gt; Items
      {
          get { return _items; }
      }
  
      public Page()
      {}
  
      public Page(int currentPage, IEnumerable&lt;T&gt; items, int itemsPerPage, int totalItems, int totalPages)
      {
          PageIndex = currentPage;
          _items = items.ToList();
          TotalItems = totalItems;
          PageSize = itemsPerPage;
          TotalPages = totalPages;
      }
  
      public int PageIndex { get; private set; }
      public int PageSize { get; private set; }
      public int TotalItems { get; private set; }
      public int TotalPages { get; private set; }
  
      public IEnumerator&lt;T&gt; GetEnumerator()
      {
          return _items.GetEnumerator();
      }
  
      IEnumerator IEnumerable.GetEnumerator()
      {
          return GetEnumerator();
      }
  }
  </code></pre>
  
  <p>Then this is parsed into a Json in the Controller when returning the action response in order to match the json structure needed for the grid plugin (whereas it is jqGrid or DataTables).</p>
  
  <p>I cannot change the Page structure and the pagination mechanics as it would hugely impact in the web application, so that's out of discussion. I need to find a way to adapt DataTables so it sends the <em>PageNumber</em> instead of the <em>Start</em> record. The <em>Length</em> parameter would match the <em>PageSize</em> on my side so it would fit perfectly.</p>