title: DataTables Next button not working
body: <p>I have a DataTable being initialized in a HTML web page, rendered piecewise by ajax calls to a Django backend. </p>
  
  <p>Everything is working great, however, the [Next] and [Last] datatable buttons are not working. Pagination works fine, Prev and First also work fine. </p>
  
  <p>DataTable code: </p>
  
  <pre><code>var object_table = $('#object_table').DataTable( {
       "sDom": '&lt;"H"lfr&gt;t&lt;ip&gt;',
       "sPaginationType": "full_numbers",
       "iOverlayFade": 100,    
       "processing": true,
       "serverSide": true,
       "ajax": '/objects/object_list/',
       "deferRender": true
       "aoColumnDefs": [ { "aTargets": [ 0 ], "sWidth": "1%",
                          "searchable":false, "orderable":false, } 
                      ],
  "columns": function ( row, data, index ) {... }] 
  });
  </code></pre>
  
  <p>And this is what the code looks like as it's passed from django on the datatables ajax call</p>
  
  <pre><code>def dt_object_list_loader:
      r_sequence = int(request.GET.get('draw', 0))
      r_length = int(request.GET.get('length', 10))
      r_start = int(request.GET.get('start', 0))
      objects = djangomodel.objects.filter(...) 
      result_list = [objects[r_start:r_start + r_length]
      response_data = {}
      response_data['recordsTotal'] = len(result_list)
      response_data['draw'] = int(request.GET.get('draw', 0))
      response_data['data'] = result_list
  
  
      return HttpResponse(jsonpickle.encode(response_data), content_type='application/json')
  </code></pre>
  
  <p>Pagination works fine, and everything loads without error. But 'next/last' are blurred out, and when I click them, django fires the error: </p>
  
  <pre><code>Internal Server Error: /home/task_list/
  Traceback (most recent call last):
  ....
  r_start = int(request.GET.get('start', 0))
  ValueError: invalid literal for int() with base 10: 'NaN'
  </code></pre>
  
  <p>DataTables also fires a cryptic Error 7 (general ajax error) when the python error throws (this doesn't provide anything aside from what table the error occurred in.</p>
  
  <p>Okay great, so I know when next or last is clicked, the r_start value provided from the datatables API is NaN. I could normally code around this by just setting the range manually, but I have no way of knowing from django which button was clicked (range for last or range for next) without doing some inane jquery. </p>
  
  <p>This datatable is copied almost exactly from another part of my program and it works fine, I just changed some of the python code to spit out a different object list...so I'm pretty confused as to why this is busting. </p>
  
  <p>I guess my question is, how can I make datatables send a more useful value on 'next' aside from just passing NaN and why are the next/last buttons blurred out? </p>