Open jevchan91 opened 6 years ago
I think the only solution to this problem is to use a custom render callback which can then ignore null objects.
I agree it has been a very annoying. But the only solution I know is to use a customer render.
Right now we use $.fn.dataTable.render.text()
as a default render callback as it sanitizes the content (like h()
method).
I wonder if we should use a default render callback that also ignores NULL. So far I found it might be better to not silently fail by default. But I wonder if we should have a 'defaultRenderCallback' kind of config for the helper.
I honestly think just using a custom rendered is fine. Im my use cases mainly I'm generating a link to a belongsTo relationship anyways so during the link generation I'm checking for null.
below this is main query with null return, render with 'number' parameter without problem. number":null,"user":{"username":"test"}
below this is contain query with null, since render parameter is 'user.username', so datatable cant get '.username' and popup an error. number":null,"user":{"user":null}
any solutions? thanks