Jump to content


how implement callback on read/view

callback read view display manipulate

  • Please log in to reply
1 reply to this topic

#1 chrisjesss

chrisjesss

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 22 April 2015 - 08:44 PM

Hello,

I have a timestamp field in my database which I want to be displayed as datetime format.

I implemented a callback_column which works fine on the grid view.

 

$crud->callback_column('created_on',array($this,'clb_timestamp_to_date'));

 
function clb_timestamp_to_date($timestamp){
return date('d-m-Y H:i:s', $timestamp);
}
 
But when one clicks on the magnifiying glass to show the single-row-view, there the original timestamp is shown, ignoring the callback.
 
Could someone please help me out on how to also manipulate the data on the single-row-view?
 
Any help is much appreciated.
 
Kind regards,
Chris

 



#2 skekeu

skekeu

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 23 April 2015 - 01:37 PM

Hi!

 

You should use the callback_read_field

The solutuin is here: http://www.grocerycr...he-read-method/







Also tagged with one or more of these keywords: callback, read, view, display, manipulate

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users