Weird dataTables Return
Weird dataTables Return
jdadwilson
Posts: 127Questions: 30Answers: 1
What might cause dataTables to return no records but not indicate 'No data available in table'. No ajax error is issued and no error appears in the cPanel log.
Here is a link.
jdadwilson
Answers
The JSON response looks like this:
See Allan's answer in this thread. You will need to change the JSON response to use these SSP response parameters.
Kevin
Kevin; I made the following change to the $output array...
Change the code accordingly.
Updated the js code as follows...
Added the two referenced scripts to my java loader script.
Noted two problems...
1. The pageLength 14, option has no effect on the number of records to display. The output was 100 records.
2. An error "Cannot read properties of undefined (reading 'Api')" was thrown on line 72 of alphabetSearch.
Here is the link to the test case... Historical Markers.
jdadwilson
Well, I don't know what exactly is happening except that not only the one module I changed (markers) but all of the modules in the whole site will now not load.
Same two errors as on the 'markers' module.
Here is the code for my java loader...
Note that some groups are commented out. Should one of them be active.
jdadwilson
That suggests that your server-side processing script is returning 100 rows. You might want to read over this part of the manual to check if you want server-side processing or client-side. If server-side, then your server-side script is responsible for paging, sorting and filtering.
Your page is loading jQuery multiple times:
and
The second one overwrites the first (which has the DataTable object attached to it).
You also appear to be loading the alphabet search plugin multiple times.
Allan
Thanks for the update. That fixed the problem. I think I need to use the client-side processing. I only have one table with over 100,000 records but all the loads from it will only select a subset of the total.
Thanks for your great support!
jdadwilson