Jump to content


Dropdown List on Add/Edit Form

WHERE SET_RELATION

  • Please log in to reply
1 reply to this topic

#1 Jamie Clarke

Jamie Clarke

    Newbie

  • Members
  • Pip
  • 4 posts
  • LocationUK

Posted 05 February 2017 - 05: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



#2 Jamie Clarke

Jamie Clarke

    Newbie

  • Members
  • Pip
  • 4 posts
  • LocationUK

Posted 05 February 2017 - 05: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'));






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users