title: DataTables ajax.reload() loses page
body: <p>I am using jQuery DataTables. After ajax request, I call <code>the ajax.reload()</code> method to refresh my dataTable but I lose the current page. It returns the first page.</p>
  
  <p>Here is my DataTables init:</p>
  
  <pre><code>datatable_appointments = $('#datatable_appointments').DataTable({
      "responsive" : true,
      "processing" : true,
      "serverSide": true,
      "bSort" : false,
      "ajax": function(data, callback, settings) {
          // make a regular ajax request using data.start and data.length
          $.get(URL_API + URL_APPOINTMENTS_STATE + '/', {
              limit: data.length,
              offset: data.start,
              search: data.search.value
          }, function(res) {
              if (res.error) {
                  callback({
                      recordsTotal: 0,
                      recordsFiltered: 0,
                      data : ""
                  });
              } else {
                  data_appointments = res.data;
                  // map your server's response to the DataTables format and pass it to
                  // DataTables' callback
                  callback({
                      recordsTotal: res.total_data,
                      recordsFiltered: res.total_data,
                      data: res.data
                  });
                  $("#datatable_appointments &gt; tbody &gt; tr &gt; td").addClass("text-center");
                  $("#datatable_appointments &gt; tbody &gt; tr &gt; td").css("vertical-align", "middle");
                  $("#datatable_appointments &gt; thead &gt; tr &gt; th").addClass("text-center");
              }
          });
      },
      "columns" : [
          { "data": "service_name"},
          { "data": "doctor_info"},
          { "data": "patient_name", render: function (data, type, row, meta) {
              return row.name + " " + row.surname;
          }},
          { "data": "appointment_date", render: function (data, type, row, meta) {
              var formattedDate = new Date(row.appointment_date);
              var day = formattedDate.getDate();
              var month =  formattedDate.getMonth();
              var hours = (formattedDate.getHours().toString().length == 1) ? '0' + formattedDate.getHours() : formattedDate.getHours();
              hours += ':';
              hours += (formattedDate.getMinutes().toString().length == 1) ? formattedDate.getMinutes() + '0' : formattedDate.getMinutes();
              return day + ' ' + months[month] + ', ' + hours;
          }},
          { "data": "state", render: function (data, type, row, meta) {
              if (row.state == '0')
                  return '&lt;i class="fa fa-circle font-red-mint"&gt;&lt;/i&gt;&lt;br /&gt;İptal';
              else if (row.state == '1')
                  return '&lt;i class="fa fa-circle font-green-jungle"&gt;&lt;/i&gt;&lt;br /&gt;Onaylı';
              else if (row.state == '2')
                  return '&lt;i class="fa fa-circle font-grey-salsa"&gt;&lt;/i&gt;&lt;br /&gt;Beklemede';
          }},
          { "data": "actions", render: function (data, type, row, meta) {
              if (row.state == '2')
                  return '&lt;div class="btn-group btn-group-circle"&gt;' +
                              '&lt;button type="button" onclick="setState(\''+row.id+'\', \'1\');" class="btn btn-outline green btn-sm"&gt;Onayla&lt;/button&gt;' +
                              '&lt;button type="button" onclick="setState(\''+row.id+'\', \'0\');" class="btn btn-outline red btn-sm"&gt;İptal Et&lt;/button&gt;' +
                          '&lt;/div&gt;';
              else
                  return '';
          }}
      ],
      "sPaginationType": "full_numbers",
      "language": {
          "emptyTable": "Kayıt bulunamadı.",
          "sZeroRecords": "Bu kriterde sonuç bulunamadı.",
          "search": "Bul",
          "sProcessing" : "&lt;img src='/assets/global/img/loading-spinner-blue.gif' /&gt;",
          "sInfo": "Toplam &lt;b&gt;_TOTAL_&lt;/b&gt; veri bulunmaktadır.",
          "sLengthMenu": "Gösterilen kayıt sayısı _MENU_",
          "sInfoFiltered": "",
          "sInfoEmpty":"",
          "paginate": {
              "sPrevious": "Önceki",
              "sNext": "Sonraki",
              "sFirst" : "İlk",
              "sLast" : "Son"
          }
  
      }
  });
  </code></pre>
  
  <p>And my <code>setState</code> method in same js file:</p>
  
  <pre><code>function setState(id, state) {
      $.ajax({
          url : URL_API + URL_APPOINTMENTS_STATE + '/' + id,
          type : 'put',
          data : {'state' : state},
          dataType : 'json',
          success : function (response) {
              if (response.error) {
  
              } else {
                  datatable_appointments.ajax.reload();
              }
          }
      });
  }
  </code></pre>