Cascading Dropdowns with changings

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
NilsSlin
Posts: 1
Joined: 2016-07-13 17:17

Cascading Dropdowns with changings

Post by NilsSlin » 2016-07-13 17:23

Hi guys, you created a wonderful program.

After several days I'm going deeper into it. Im planning to create a table for our teachers, where they can organize our courses and so on.
I want, that every teacher enters his courses (just one field called "title" e.g. "general linguistics") after that the teacher has to provide a time out of a dropdownlist.
If the same teacher enters a second course (e.g. "sociolinguistics") I want that the timetable hides the time chosen for the first course.

Is that possible?

Yours,
Nils

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: Cascading Dropdowns with changings

Post by shasta59 » 2016-07-31 14:52

Yes it is possible to do.
I would add in a field - time_taken. This field would be a simple check box which is not seen by the average user but would be filled in when the teacher submits the course. This field is then looked at when the times are displayed and you would need to write code to see what times are taken by looking at the status of the time_taken field. You also need to write code to fill in this field upon save. (You can write code so that an admin can see this field at all times but teachers cannot. )

Do not forget to write code to clear the time_taken field if a teacher changes the choice of time for the course.

Ex: Teacher selects 9 AM to 10 AM. When saved your code checks time_taken. When another teacher wants to book a course the dropdown of times available has code you wrote to look at the time_taken flag and not display any time which is taken for that course.

Next: When a teacher changes the time or lets the time go your code would set the field for that first time to empty and block out the new time.

You will also need to decide how you are grouping your courses. Do you want this only to affect courses in the same area - eg: history. Or when that time slot is taken it is taken up for everyone and no other course can be put in that time slot even if it is not related to the first course. Depends on how many courses you have.

Hope this helps a bit. It is all very doable in at least three different places.
Best of luck.
Not sure if this makes sense to you but I can visualize how to do it and I do something similar for one application I made where it only displays those sessions where there are still spots available to register for. I check for qualifications etc and it will display, in the drop down, only those sessions which the person's qualifications allow them to attend. (After making sure the session is not full).

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

Post Reply