Search does not occur in grocery

The product basket does not search for linked tables.

Search occurs only for these table fields.

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();
} 

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;
    }
}

Here the search does not occur for the name.

Does anyone have a solution for this?

Thanks in advance.

+5
source share
2 answers

Hi @DelvinPaul: I hope your problem is resolved. Just in case, if you don’t solve it, try debugging your request internally changeNamewith

log_message('info','Query: '.$this->db->last_query());
log_message('info','Result Returned: '.print_r($new,true));

put these instructions after the following line in your changeName function:

$new = $this->db->select('name')->where('another_table.id', $row->id)->get('another_table')->result();

And do not forget to change $config['log_threshold'] = 3;in your configuration file. After debugging, update your question for clarity so that we can answer.

+2
source

Using

$crud->set_theme('datatables');

Instead

$crud->set_theme('flexigrid');

u . flexgrid.

0

All Articles