1-to-many checkbox grouping
1-to-many checkbox grouping
I have the following tables:
tbl_1: id, .... (main table)
tbl_2: tbl_1_id, tbl_3_id (composite key)
tbl_3: id, category, description
this structure should work easily following provided one-to-may join example. However, I want to group the checkboxes (coming from table 3) based on category. I cannot find a way to do this.
What I did is creating a view for each category then Mjoin each one. The problem now, only the last view (category/group of checkboxes) gets inserted/updated into tbl_3
any suggestion is appreciated.
This question has an accepted answers - jump to answer
Answers
The built in
checkbox
type doesn't have an option to provide grouping I'm afraid. That's a very good idea for a future enhancement though, and I've added that to my list.At the moment, I'm afraid you'd need to create a plug-in field type that would implement the grouping for checkboxes.
Regards,
Allan
that's a good idea. I recently extended the built-in upload. It was awesome how the filed types work. I think extending the checkboxes should be a piece of cake.
thanks Allan.
it wasn't too hard to make a replica of the current checkbox field type, with little modification to add a title before each group. the only issue I had was that I had to use the text "label" by using string.split() to get the information I needed. I wasn't able to access the returned array!
Excellent - nice one!
Allan