I have tables with this schema:
users(id, name, email) user_details (id, user_id, physical_address, otherinfo)
I would like to display the entire contents of both tables in the same grid using grocery crud when I try to use the set relation in the first table, as shown: Note: I restored the part that renders the view;
$crud = new grocery_CRUD(); $crud->set_table('users'); $crud->set_relation('id', 'user_details', '{physical_address} + {otherinfo}');
the values ββof the id field, as well as the reference table, are not displayed in the grid, so when using primary keys it does not work.
So, I decided to start with the contents of the second table as follows:
$crud = new grocery_CRUD(); $crud->set_table('user_details'); $crud->set_relation('user_id', 'users', '{name} + {email}');
This works, but the problem is that the values ββare displayed in a single column in the grid. I would like to know how I can split them into different columns and make them editable in separate input fields.
source share