iDisplayStart, iDisplayLength, sEcho are all null in server side!

iDisplayStart, iDisplayLength, sEcho are all null in server side!

bacloud14bacloud14 Posts: 16Questions: 3Answers: 0
edited December 2014 in Free community support

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.

Answers

  • bacloud14bacloud14 Posts: 16Questions: 3Answers: 0
    edited December 2014

    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.

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin

    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

This discussion has been closed.