dandelion / dandelion-datatables

Dandelion component for DataTables
http://dandelion.github.io/components/datatables/
Other
110 stars 49 forks source link

server-side processing with json-plugin (no MVC) not working #320

Open Kaspatoo opened 7 years ago

Kaspatoo commented 7 years ago

Hi,

when using json-plugin because use of struts instead of MVC then eithere data or pagination is not printed correctly.

At first the "DatatablesResponse.build" cannot be used because jsonplugin then creates a response like {"datatablesResponse": { "data":[{...}], "draw":1, "recordsFiltered":500, "recordsTotal":2591 } }

and because of the prefix datatablesResponse no data is printed and pagination also is not working.

When creating a reponse by hand such that its like this: { "data":[{...}], "draw":1, "recordsFiltered":500, "recordsTotal":2591 }

Then the data is shown but pagination does not work properly:

"Zeige 1 bis 500 von 500 Eintr�ge (filtered from 2,591 total entries)"

Due to this, paging only shows one single page.

When adding deferLoading:

then its showing no data at all: "No matching records found" and "Zeige 1 bis 500 von 2,500 Eintr�ge" Is it a bug or a missing feature? Meas is server side processing only implemented for usage of MVC and does not support others like strus json-plugin? Basically I'd expect to have a clear interface where the information comes from the json webserver and datatables then is rendering it.
Kaspatoo commented 7 years ago

changed my mind: I misused "recordsFiltered":500, should be set to the total amound of data provided over all pages (here 2500 since thats our desired maximum of overall elements)

But using pipelining and deferLoading still do not work While pipelining seems to have no effect (every paging a new request is done), page 5 does take the same time to load like page 2 when setting pagesize to e.g. 3. DeferLoading causes still to see no matching records in the list but saying there were about 2500 records available on paging.