iDisplayStart, iDisplayLength, sEcho are all null in server side!
iDisplayStart, iDisplayLength, sEcho are all null in server side!
bacloud14
Posts: 16Questions: 3Answers: 0
Hi there!
I am a datatables newbie so please forgive my ignorance! (and my expression in English)
I just want to retrieve some parameters in server side, but all of them are nulls,
String sStart = request.getParameter("iDisplayStart");
String sAmount = request.getParameter("iDisplayLength");
String sEcho = request.getParameter("sEcho");
String sCol = request.getParameter("iSortCol_0");
String sdir = request.getParameter("sSortDir_0");
even search columns are nulls:
engine = request.getParameter("sSearch0");
browser = request.getParameter("sSearch1");
platform = request.getParameter("sSearch2");
version = request.getParameter("sSearch3");
grade = request.getParameter("sSearch4");
I'm using JavaEE, with these imports in client page initiating Ajax requests:
jquery.dataTables.css 1.10.4, jquery-1.11.1.min.js, query.dataTables.min.js 1.10.4
please help me.
This discussion has been closed.
Answers
Finally I found the solution!
It just have a both client and server problem,
in server I added the Echo parameter,
in client I changed:
"processing": true,
"serverSide": true,
to
"bProcessing": true,
"bServerSide": true,
I don't know why it works now and what is the difference, as I copied the first code from and example here in this webite.
It "works" now, because you have forced DataTables into legacy mode by using the old bServerSide rather than the newer
serverSide
option. That forces DataTables to send the old style of parameters.Allan