Hi guys,
I have the following problem. I have two main tables ('Produkte' and 'Systeme') and one junction table for the n-n relation ('Produkte_Systeme'). I need to add the information about Systeme to the Produkte table - this works without problem using the below code:
$crud->set_table('Produkte'); ... crud->set_relation_n_n('Systeme', 'Produkte_Systeme', 'Systeme', 'Produkt_ID', 'System_ID', 'Bezeichnung');
But now I want to use a filter on System_ID to show only products for a certain system. I tried to use the following code according to the forum post here to get only products which are related to system with ID 3:
$crud->set_relation_n_n('Systeme', 'Produkte_Systeme', 'Systeme', 'Produkt_ID', 'System_ID', 'Bezeichnung', null, array('ID'=>3));
But the filter does not apply to the table view, only to the available options on the add/edit forms (in case of the example it limits the available systems from 1 to 3.
How can I add the where clause to the entire table / view?
I would appreciate any help. Thanks!