I send data to my DataTables and they are valid - but not shown in a table.
I send data to my DataTables and they are valid - but not shown in a table.
PoulMK
Posts: 1Questions: 1Answers: 0
http://maagaardlogistik.dk/
No debugger code
No errormessages
Hi
I have struggled for nearly a week with DataTable but simply cannot make it work. It accepts the data, but for some reason the data is not shown in a table.
- Start my test program by typing
maagaardlogistik.dk
in the addressline of your browser. - When the screen appears, start your Chrome-debugger and then the Console Display. There you should be able to see the data I send to DataTables. If not, refresh the page.
- If you would like to see how the data is created, start VS Code and load dbr.php.
There are two places in the switch, case '29' and case '98'.
No 29 is the one that fetches the data from my database, no 98 is one where I created a few records manually. No 98 works, no 28 is the one I need and so - off course - that is the one that does not.
Start your VS Code, enter dbr.php and place a breakpoint at the top and run the program as described in 1. or by pressing the refresh button.
You can then step down to which one of the two you want to look at.
I am fairly convinced that anyone as stunningly good a programmer as you, can solve this problem in a few minutes, but if you don't have the time, please let me know within a few days, so I can find an alternative.
Best regards
Poul
Answers
This is the JSON response:
You row data is in the
data
object but you setajax.dataSrc
todataSrc: '',
. Remove this option to allow Datatables to find the data in the defaultdata
object. See the ajax docs for more details.You defined
columns.data
with the column index value, for example:THis should work but is not necessary.
Kevin