Modifying existing page with DataTables to ServerSide
Modifying existing page with DataTables to ServerSide
Hi,
I am trying to change an existing page I have that is already working with DataTables, to work with serverSide processing.
Got to a situation that the data loads successfully to the page, with the limited amount of records (25).
The issue is that I can't seem to switch pages. There is no javascript error.
When checking on my server, I noticed that the request is being sent to the original page and not to the ajax endpoint for some reason.
Couldn't find same behavior in the forum, so I'm writing my own question.
e.g my page is https://domain/somepage.php
my ajax endpoint is: https://domain/ajax_some_endpoint.php
I can see that the first call to the somepage.php is being followed with a call to the ajax endpoint, and the data really appears on the table.
When trying to switch pages, for some weird reason the server gets a call only for the somepage.php with the parameters that should have been passed to the ajax_some_endpoint.php (with draw, start and limit, and all the filters).
Any idea why its happening? Am I doing anything wrong with the implementation?
Thanks,
Ido
Answers
I debugged the unminified version, and found that there is a bug that occurred due to the use of the plugin: jquery.dataTables.columnFilter.js
It for some reason breaks the ajax functionality.
When I removed this plugin, server side pagination worked fine.
Will update if I succeed in figuring what exactly breaks it, or maybe which other plugin will be used instead.
Will update tomorrow.
Thanks,
Ido