Page display and server side processing

I followed this instruction: http://datatables.net/release-datatables/examples/server_side/server_side.html But I do not get pagination (neither in bJQuery mode, nor in classic). Everything works fine (search, order, ...), but I canโ€™t get the pagination.

Is there something I am missing?

Here is the code:

$(document).ready(function() { $('#datatable').dataTable( { bJQueryUI : true, "bProcessing": true, "bServerSide": true, sPaginationType: "full_numbers", "sAjaxSource": "/returnjson" } ); } ); 

Thanks!

Edit: I put my options in quotation marks. Thank you dgw, it doesnโ€™t change anything. I want the paging buttons to interact with my server code:

 /* * Paging */ $sLimit = " LIMIT 100"; if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' ) { $sLimit = " LIMIT ".mysql_real_escape_string( $_GET['iDisplayStart'] ).", ". mysql_real_escape_string( $_GET['iDisplayLength'] ); } 

thanks for the help

Edit 2: I tried using both datatables / demo_table.css and datatables / demo_table_jui.css, but that does not change anything.

Thanks again!

+4
source share
2 answers

My iTotalDisplayRecords were set incorrectly (Total records after filtering). Source: http://datatables.net/usage/server-side

+3
source

Indicate for example

 "sDom": '<"top"i>rt<"bottom"flp><"clear">' 

within your call to dataTable . This should show pagination.

For more information, see the link to data options , especially the sDom part.

+1
source

Source: https://habr.com/ru/post/1392498/


All Articles