Hi Amit,
I am struggling to make it work, basically I am trying to set a text box with vendor name when a user clicks on ADD, the vendor name will be read only and user can fill all other fields as the ADD form is coming from a select list as described above in my first post.
I am using a call back here and trying to run another query in callback to fetch vendor name but the text field is always coming blank.
//User selects Vendor here
$crud->add_action('View Menu Items', '', 'admin/menu_items','ui-icon-plus');
//when user clicks ADD
$crud->callback_add_field('vendor_menu_items.vendor_id',array($this,'add_field_callback_1'));
function add_field_callback_1(){
$this->db->where('vendor_id',1)
$row = $this->db->get('vendor')->row();
//echo $vendor->vendor_short_name;
return '+30 <input type="text" maxlength="50" value="'. $result->vendor_short_name. '" name="vendor_id2" style="width:462px">';
//echo $vendor_id;
//echo $row;
}