Hi good day;

Im working with Ignited Datatables and Im trying to add a callback on edit_column but it's no working it's not making the call just print the 3 parameter :

   $this->datatables->edit_column('value','$1','callback_esNulo(value,id)');

and this the function callback

  function esNulo($value,$id){
     $result= is_null($value) ?  "0" :  "1";
     echo $result;
    }

I hope can help me thanks ....

Maybe you should compare your format with this link. You may need to change the $this->datatables->edit_column to be more verbose that that...

the diference between the script is just the way im calling the object I have multiple :

   $this->datatables->select('id,value');
   $this->datatables->from('table');
   $this->datatables->edit_column('value','$1','callback_esNulo(value,id)');

I don't understand why it's just printing 'callback_esNulo(value,id)' at table..

Hmm.. If I see it correctly, on the page, it is ...

$datatables->select(...)->from(..)->edit_column(..., ..., ...);

Member Avatar for diafol
$this->datatables->edit_column($column, $content, $match_replacement);

Was what I got from the github link which suggests that you need to place a match regex not a callback. Where did you get the references for a callback?

What is your this variable? Also, did you check if you really connect to the database?

the connection to DB it's working fine

Hmm... difficult to sugest... But here... try adding public in front of your function as public function esNulo($value,$id) {?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.