Datatable icon indicating copy to clipboard operation
Datatable copied to clipboard

[develop] can't use function names as callbacks

Open Javier-Rotelli opened this issue 9 years ago • 0 comments

if you use a function name as a callback, it gets escaped as a string. Expected

$table->setCallbacks(['fnDraw'=>'myFnDraw']);

should generate:

{
    fnDraw: myFnDraw
}

current

{
    fnDraw: "myFnDraw"
}

this is because the options and the callback get merged and treated equally.
here: https://github.com/Chumper/Datatable/blob/develop/src/Chumper/Datatable/Table.php#L299 and here: https://github.com/Chumper/Datatable/blob/develop/src/Chumper/Datatable/Table.php#L372

Javier-Rotelli avatar Sep 30 '15 20:09 Javier-Rotelli