laravel-datatables icon indicating copy to clipboard operation
laravel-datatables copied to clipboard

Warning using column with orthogonal data

Open adantart opened this issue 1 year ago • 1 comments

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 ?

adantart avatar Aug 22 '22 14:08 adantart

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"
}],

simsar78 avatar Aug 23 '22 12:08 simsar78

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 07 '22 02:10 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Oct 15 '22 00:10 github-actions[bot]