title: jQuery AJAX call in jTable
body: <p>I am trying to implement paging in <a href="http://www.jtable.org/" rel="nofollow">jTable</a>.
  Can anyone help me understand the code below? I have read the jQuery Ajax documentation and understand all but the URL, specifically what is the url referring to?  Why is the url field formatted the way it is?  e.g. why /demo/studentlist?jtStartIndex what does this mean?</p>
  
  <pre><code>listAction: function (postData, jtParams) {
      return $.Deferred(function ($dfd) {
          $.ajax({
              url: '/Demo/StudentList?jtStartIndex=' + jtParams.jtStartIndex + '&amp;jtPageSize=' + jtParams.jtPageSize + '&amp;jtSorting=' + jtParams.jtSorting,
              type: 'POST',
              dataType: 'json',
              data: postData,
              success: function (data) {
                  $dfd.resolve(data);
              },
              error: function () {
                  $dfd.reject();
              }
          });
      });
  }
  </code></pre>
  
  <p>Currently I have a php script that is calling stored procedures in a mysql database. Is AJAX the <strong>only</strong> way to implement paging in this case or could I implement the above for paging using jTable by doing something along the lines of:</p>
  
  <p>(Redudant code not included)</p>
  
  <pre><code>//open database etc
  $offset = $_POST['jtStartIndex'];
  $amount = $_POST['jtPageSize'];
  $result = $mysqli -&gt; query ("CALL Proc($offset, $amount);
  //while loop using fetch_assoc() to assign row objects to rows array
  $jtableResults['Result'] = "OK";
  $jtableResults['Records'] = $rows;
  //close
  echo json_encode($jtableResults);
  </code></pre>
  
  <p>MySQL Procedure:</p>
  
  <pre><code>CREATE DEFINER='user''@'%' PROCEDURE 'Proc' (offset INTEGER, amount INTEGER)
  BEGIN
  SELECT * FROM reports Order By idReports ASC LIMIT offset, amount;
  END
  </code></pre>
  
  <p>I believe I cannot do above because jTable expects the jtParams object back in a AJAX call?  </p>