how to implemenent real server side pagination

how to implemenent real server side pagination

laurelaure Posts: 6Questions: 1Answers: 0

i need to implement a real server side pagination based on sql requets like SELECT ... LIMIT x,y
my datatable is still offering pagination capabilities (full_number) on the user interface,
but data are requested once via ajax request.
i want the data to be requested when needed.
how can i do this?
thanks four help.

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Sounds like you want server-side processing. It will only request the data needed for each page.

    Allan

  • laurelaure Posts: 6Questions: 1Answers: 0

    hello allan,

    yes. that's it. it is doing what i want.
    do i need to implement sort and search on server side too?.
    is it possible to mix client and server depending on what to do?
    i have DataTables 1.9
    Laure

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    do i need to implement sort and search on server side too?

    Yes - that's the whole point of server-side processing. The server does the processing :-)

    is it possible to mix client and server depending on what to do?

    No. You either use DataTables in client-side processing mode, or server-side processing mode.

    i have DataTables 1.9

    Documentation for old versions is available on the legacy site.

    Allan

  • laurelaure Posts: 6Questions: 1Answers: 0

    ok. i can go with that.
    just another question:
    i am using the full_numbers pagination.
    the button next and last are sending NaN for iDisplayStart value.
    i don't get why. Other buttons are working fine.

    Laure

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Can you link me to the page showing the problem please. That doesn't appear to be happening in the examples on this site.

    Allan

  • laurelaure Posts: 6Questions: 1Answers: 0

    sorry that's not possible. it' an intranet application.
    i just set sPaginationType to full_numbers and bServerSide to true.
    sAjaxSource is configured too. do i need to do something more?
    thanks.

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    edited May 2014

    No - that should be all you need to do. I'm afraid I can't offer any more help than that without being able to see, understand and debug the problem.

    Edit - I presume you have correctly implemented server-side processing on the server? Try using the debugger please.

    Allan

  • laurelaure Posts: 6Questions: 1Answers: 0

    hello allan,
    i need some documentation concerning JSON data that dataTables 1.9.0 can consume from the server in serverside mode . i am still using 1.9.0 . i need to know how to return the total number of records and not only th requested data for pagination which i returned in aaData.
    thanks.
    Laure

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    The legacy documentation is currently linked from every page on this site at the top in the "Latest news" box. For legacy server-side processing, you want this page: http://legacy.datatables.net/usage/server-side

    Allan

This discussion has been closed.