Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

[develop] can't use function names as callbacks #338

Open
Javier-Rotelli opened this issue Sep 30, 2015 · 0 comments
Open

[develop] can't use function names as callbacks #338

Javier-Rotelli opened this issue Sep 30, 2015 · 0 comments

Comments

@Javier-Rotelli
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant