dataTables showing too much lines or not reloading with new data

dataTables showing too much lines or not reloading with new data

CptFantasticCptFantastic Posts: 2Questions: 0Answers: 0
edited January 2013 in DataTables 1.9
I admit it I'm new to JQuery and dataTables, but I think everybody has, one day , been new to it.
My problem is that I'm a bit puzzled on the behavior of dataTables.
I'm trying to show a list of strips in the dataTables. This list is based on the 'serie' id. I want to refresh the list based on a drop-down selection.
When I use the parameter 'serverSide : false' dataTables shows up correctly but it will not reload when I select another serie.
When the parameter 'serverSide: true' is set the reload works fine but the table shows all the lines (note that the bottom information show i.e. 'Showing 1 to 5 out of 20 elements' which is wrong).

Running examples are
http://testsite.bigm-web.com/liste-series_ajax_datatables_noserverside.php
http://testsite.bigm-web.com/liste-series_ajax_datatables_serverside.php


And the source codes
http://testsite.bigm-web.com/sources/?M=A

I'm using JQuery 1.8.2 and dataTables 1.9.4.

So if anybody can explain why this behavior with serverSide param on (I know I read in one of the threats that with serverside processing dataTables is not doing the work -or something like that- but I think it should still follow the rules that have been set => show 5 lines

If anybody can tell me how I can have my table reloaded when I make a new selection in my drop-down whith the serverSide param set to false I'll be happy.

Sincerely yours

Marc

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Its not working because you haven't correctly implemented server-side processing: http://datatables.net/usage/server-side . If you want server-side processing and it requests 5 rows (which it is), then you should only return 5 rows (which it isn't - it is returning 20).

    Allan
  • CptFantasticCptFantastic Posts: 2Questions: 0Answers: 0
    I got the point about server-side, but since my data is at-most 60 records I didn't really want to go to server-side processing.
    The server-side processing option was mainly to see if my data gets updated, and it does, but why with simple ajaxSource the function fnDraw (even if I use the fnClearTable() function) will not update my dataTable ?
This discussion has been closed.