One to many relationships mysql DB
One to many relationships mysql DB
Hi all,
I've been trying various tools to help me generate datagrids to work with a few tables in a mysql database. I just wanted to check how datatables can handle one to many relationships before I start spending time learning how to use it, I've tried a few other tools and they haven't worked out for me.
Basically I need to produce a datagrid that would allow me to assign an employee to many groups and view the groups they are assigned to using the following tables:
Employee Table employee_ID
Group Table group_ID
EmployeeGroup Table employee_ID group_ID
I'm not quite sure how best to do this with datatables, could I produce a master-detail grid? Or is there another clever way to display the groups inline.
Any thoughts would be very much appreciated.
Thanks
I've been trying various tools to help me generate datagrids to work with a few tables in a mysql database. I just wanted to check how datatables can handle one to many relationships before I start spending time learning how to use it, I've tried a few other tools and they haven't worked out for me.
Basically I need to produce a datagrid that would allow me to assign an employee to many groups and view the groups they are assigned to using the following tables:
Employee Table employee_ID
Group Table group_ID
EmployeeGroup Table employee_ID group_ID
I'm not quite sure how best to do this with datatables, could I produce a master-detail grid? Or is there another clever way to display the groups inline.
Any thoughts would be very much appreciated.
Thanks
This discussion has been closed.
Replies
*edit* Rereading your question I see I didn't fully answer it above. Yes a master details grid is an option, or what I often do for that kind of thing is use ellipsis with a column in the table, so it would do something like "Groups: First, Second and 3 more (show)" or "Groups: First" and so on.
Again, it doesn't matter too much to DataTables how you do this - if it is tabular data then DataTables should be able to handle it (there are a few exceptions such as colspan/rowspan in the tbody...)
Allan