I have two tables that need to be linked: 'user' and 'dealer'. The relation table is 'user_dealer'.
I found using $crud->set_relation_n_n()
works well for edit and add screens to restrict which records are edited and added, like this:
$crud->set_relation_n_n('Dealers', 'user_dealer', 'dealer', 'user_id', 'dealer_id', 'dealer', null, array('id' => $this->session->userdata('dealer_id')));
But for some reason, this does not work for the LIST grid.
I tried $crud->where()
but this does not work, as it does not have the column from the relation table there.
Can anybody help, please?
Apparently this is not possible, so I had to write a custom model that extends the Grocery Crud model and do what I needed to do.