laravel-datatables
laravel-datatables copied to clipboard
Warning using column with orthogonal data
Hi! I try to create a column with two data, in order to use it after in Javascript with one data to display and other to sort.
So the idea is this:
->addColumn('date', function ($row) { return [
'display' => "a",
'timestamp' => "b"
]; })
And in Javascript t o use this:
{
data: {
"_": "date",
"sort": "date_sort"
},
name: 'date', orderable: true
},
But when I try to make the Datatables json in the server, Laravel outputs tongs of these error in log:
[2022-08-22 16:20:12] local.WARNING: strnatcasecmp(): Passing null to parameter #1 ($string1) of type string is deprecated in /home/project/vendor/yajra/laravel-datatables-oracle/src/CollectionDataTable.php on line 319
[2022-08-22 16:20:12] local.WARNING: strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in /home/project/vendor/yajra/laravel-datatables-oracle/src/CollectionDataTable.php on line 319
Why is that ?
The data returning have a one or more field null? If yes try with this code:
columnDefs: [{
defaultContent: "<span class='text-disabled'>-</span>",
targets: "_all"
}],
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.