⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Dropdown List on Add/Edit Form



Jamie Clarke

Jamie Clarke
  • profile picture
  • Member

Posted 05 February 2017 - 17:06 PM

Hi,

 

I am trying to limit the dropdown list that is displayed on the Add/Edit form after I have set a relation to another table. I have tried to set a WHERE on the related table but all values are being pulled in.

 

The table - $crud->set_table('tbl_ticket_category');

 

The relation - $crud->set_relation('tc_default_group','tbl_group','group_name');

 

I am trying to limit the GROUP_NAME list by GROUP_ORG field, and this doesnt have an affect

 

$crud->where('group_org', $this->org);

 

Help!!

 

Thanks


Jamie Clarke

Jamie Clarke
  • profile picture
  • Member

Posted 05 February 2017 - 17:25 PM

Solved it by reading the full document...

 

You can also have a where clause at the 4th parameter (is not a required parameter). For example: 

$crud->set_relation('user_id','users','username',array('status' => 'active'));