Allowing multi select in a field with child table lookup

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
Osman
Posts: 4
Joined: 2017-08-26 15:32

Allowing multi select in a field with child table lookup

Post by Osman » 2017-10-31 22:43

Hi,
I have a main table with one of the fields set to allow lookup into another table (Parent Child) in order to populate the field.
I am able to select a value from the child table and update my parent table filed.

Is there a way to allow multiple selection from the child table to populate the parent field

I read that setting the field type to "set" type would allow that in MySQL, so I did that in the MyPHPAdmin panel, then set it to allow up to three entries.

However, I am not sure how to make that work in AppGini.

Hopefully someone can shed some wisdom.

Thank you!

Abeer
Posts: 18
Joined: 2017-03-12 09:19

Re: Allowing multi select in a field with child table lookup

Post by Abeer » 2017-11-15 07:52

let's say you have "students" table that have field "course" as a lookup field for courses table, and you want to select multiple courses for each student.

i think their is different way to do this, you can make a third table "students_courses" as a child table for students, and that table should have two lookup fields, one for courses and another for students, and each course for each student will be a record in students_courses table.

I'm not sure if i got your point correctly :)

Osman
Posts: 4
Joined: 2017-08-26 15:32

Re: Allowing multi select in a field with child table lookup

Post by Osman » 2017-11-17 19:43

I think I got the idea. If I understand you correctly and as an example if I want to allow up to 3 course selections per student, I can configure the table to have the following four fields: Student, Course_1, Course_2, Course_3, and make that table to child table than have the full row display. Is that what you are thinking...

Abeer
Posts: 18
Joined: 2017-03-12 09:19

Re: Allowing multi select in a field with child table lookup

Post by Abeer » 2017-11-22 05:27

not exactly, you don't need to have three fields in the child table, you need to add three records to it instead, one for each course the student take.

kindly check this Reply:
https://forums.appgini.com/phpbb/viewto ... 7436#p7450

I hope I explained it better there :)

Post Reply