⚠ 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 forum is read-only and soon will be archived. ⚠


Member Since 04 Nov 2020
Offline Last Active Nov 22 2020 10:28 AM

Topics I've Started

Set Relation (dropdown to show only available products)

19 November 2020 - 06:04 PM

Hey guys! I am using Grocery Crud Enterprise with Code igniter 3.


I have two Tables. 

Table 1= Rentals (Rental_id, Product_id, Rental_type, Start_Date, End_Date)

Table 2= Products (Product_id, Product_name)


I am using  $crud->setRelation('product_id','products','product_name'); so where I add a new rental there is a dropdown, so I can choose a product.


My problem is that I would like to find a way, to be able to see only the "available" products in this dropdown.


I have created a view= Available_Products, where I can see in a third table only the available products.


Where I use 




I can see all the rentals in the table, and only the available products in the dropdown list, but when I click +Add Rental, there is an error. (Maybe because it is a view, and not a table)



is there a way to fix it? or an other way to make it work?


Thanks in advance, please save me ! :)





"Add new" in dropdown list (Set Relation)

11 November 2020 - 05:29 PM

see below