在杂货店中,相关表格不会进行搜索.
搜索仅发生在该表字段中.
function index() {
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('table_name');
$crud->display_as('id','Name');
$crud->callback_column('id', array($this, 'changeName'));
$output = $crud->render();
}
Run Code Online (Sandbox Code Playgroud)
function changeName($value, $row) {
$new = $this->db->select('name')->where('another_table.id', $row->id)->get('another_table')->result();
if(!empty($new)){
return $new[0]->name;
} else {
return $value;
}
}
Run Code Online (Sandbox Code Playgroud)
这里搜索名称没有发生.
有人有解决方案吗?
提前致谢.