DataTables warning: table id=foo - Requested unknown parameter 'bar.name'
DataTables warning: table id=foo - Requested unknown parameter 'bar.name'

Hi!
I am getting the error (warning) "DataTables warning: table id=foo - Requested unknown parameter 'bar.name'". This occurs, when a relation to a foreign table is NULL. But this is perfectionally reasonable. My entries in 'foo' can have a related 'bar' or not. The field bar_id is nullable and in this given case actually NULL.
Can I tell datatables. yes, that's ok, move on? An stop displaying these pup-pus?
TIA & cu,
ada
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @system.bonn@gmail.com ,
Is this with
serverSide
, or with Editor? Could you post the server-side script, please, it would help to make suggestions.Cheers,
Colin
Hi!
This occurs with DataTables (only Datatables, not Editor) when I setup a table in laravel-datatables. If there is a relationship to another table (pos.group_id -> group.id), and the 'on-field' (pos.group.id) is NULL:
And:
PhonesDataTable.php:
Please let me know, when you need further information.
cu,
ada
Yes - use
columns.defaultContent
to tell DataTables what to do if this is expected (i.e. you could set it to be an empty string).Allan
Thank, you!
It works, although I prefered to solve it in the laravel model using 'withdefaults'.
thx & cu,
ada