set_relation field
- Single Page
Posted 19 June 2012 - 03:39 AM
example
set relation field1(id) tableB field3(name). This will show the names of tableB. This correct.
Does it use same name fields in both tables as a link point?
Posted 19 June 2012 - 09:05 AM
As you know, in set_relation function you have to specify at least 3 parametres: actual field in this table, the related table and any field from the related table that you want to show (and not just primary key field). When you use set_relation function, grocery CRUD will automatically create a dropdown list based on the content of your field in the related table.
When the user choose something from that dropdown, grocery CRUD will use the primary key of the field in the related table. So the link point is not the sameness of name fields.
Please, read about set_relation at the docs section. I think web-johnny's explanation is more clear and undestandable then mine
Posted 20 June 2012 - 13:44 PM
Posted 20 June 2012 - 21:19 PM