datatables icon indicating copy to clipboard operation
datatables copied to clipboard

data as array are forbidden

Open xJuvi opened this issue 2 years ago • 1 comments

In some cases it's useful to define a single dataset as array, f.e. if you want to order by an id bis display a human readeble name.

One example which i tried with server-side rendering is here: https://datatables.net/manual/data/orthogonal-data#Predefined-values

Is it possible to change it' I first look into the source code i think there are much changes required. If i try to define data as array i get an exception:

Fatal error: Uncaught TypeError: Return value of Ozdemir\Datatables\Column::value() must be of the type string, array returned in /var/www/vhosts/httpdocs/wwwroot/vendor/ozdemir/datatables/src/Column.php:75 Stack trace: #0 /var/www/vhosts/httpdocs/wwwroot/vendor/ozdemir/datatables/src/Datatables.php(219): Ozdemir\Datatables\Column->value(Array) #1 [internal function]: Ozdemir\Datatables\Datatables->Ozdemir\Datatables\{closure}(Object(Ozdemir\Datatables\Column)) #2 /var/www/vhosts/httpdocs/wwwroot/vendor/ozdemir/datatables/src/Datatables.php(220): array_map(Object(Closure), Array) #3 [internal function]: Ozdemir\Datatables\Datatables->prepareRowData(Array) #4 /var/www/vhosts/httpdocs/wwwroot/vendor/ozdemir/datatables/src/Datatables.php(207): array_map(Array, Array) #5 /var/www/vhosts/httpdocs/wwwroot in /var/www/vhosts/httpdocs/wwwroot/vendor/ozdemir/datatables/src/Column.php on line 75

xJuvi avatar Feb 02 '23 21:02 xJuvi