title: Limit of displaying rows in DataTables
body: <p>I use Datatables 2.0. How can I set the limit of display number of rows?</p>
  <p>I have 1000 rows that are all showing on one page.
  At Datatables 1.9 it was going with 'iDisplaylenght'.
  But in Datatable 2.0 I've tried to set 'lenght:10' like in this documentation: <a href="http://next.datatables.net/manual/server-side" rel="nofollow noreferrer">http://next.datatables.net/manual/server-side</a>
  but it doesn't work.</p>
  <p>EDIT:
  <a href="https://i.stack.imgur.com/UcIlM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UcIlM.jpg" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/W8Rsi.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W8Rsi.jpg" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/rhCAA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rhCAA.jpg" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/ED6pK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ED6pK.jpg" alt="enter image description here" /></a></p>
  <p>on this link above you can see my problem.
  It doesn't matter which number I choose from the checkbox.</p>
  <p>I have found out, with the link from @Julian(thanks), that if I don´t use the ajax call, it works fine. But if I get my data from the server-side all of my data are showing. See the link. So it must be a problem on the server-side?!</p>
  <pre><code>@SuppressWarnings(&quot;unchecked&quot;)
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      String sql = &quot;SELECT UID,LastName,FirstName FROM employe LIMIT 1000&quot;;
      
      int rows=0;
      int count = 0;
      JSONArray arrayback = new JSONArray();
      JSONObject object = new JSONObject();
      PrintWriter out = response.getWriter();
      
      try {
  
          Class.forName(&quot;com.mysql.jdbc.Driver&quot;);
          Connection con = DriverManager.getConnection(&quot;jdbc:mysql://localhost:3306/check&quot;,&quot;****&quot;,&quot;****&quot;);
          Statement stmt = con.createStatement();
          ResultSet rs = stmt.executeQuery(sql);
          ResultSetMetaData meta = rs.getMetaData();
          rows= meta.getColumnCount();        
          
          while(rs.next())
          {
              JSONArray array = new JSONArray();
              array.add(rs.getString(&quot;UID&quot;));
              array.add(rs.getString(&quot;LastName&quot;));
              array.add(rs.getString(&quot;FirstName&quot;));
              count++;
              arrayback.add(array);
              
          }
          
          object.put(&quot;aaData&quot;, arrayback);
          object.put(&quot;sEcho&quot;,1);
          object.put(&quot;iTotalRecords&quot;, count);
          object.put(&quot;iTotalDisplayRecords&quot;, count);      
          out.print(object);          
          
      
          con.close();
  }catch(exception e)
  {
  e.printStackTrace();
      }
  }
  </code></pre>
  <p>This is my server code.</p>