In case you've missed it, you are looking at an older version of the website. Checkout our latest version, we promise you will love it 😍

callback_edit_field example

function example_callback_edit_field(){
    $crud = new grocery_CRUD();
 
    $crud->set_table('offices');
    $crud->set_subject('Office');
    $crud->required_fields('city');
    $crud->columns('city','country','phone','addressLine1','postalCode');
 
    $crud->callback_edit_field('phone',array($this,'edit_field_callback_1'));
 
    $output = $crud->render();
 
    $this->_example_output($output);
}
 
function edit_field_callback_1($value, $primary_key)
{
    return '+30 <input type="text" maxlength="50" value="'.$value.'" name="phone" style="width:462px">';
}
Note: The below example is an iframe so it might appeared with a scroll bar. If you like you can view the example on a new tab