The app is taking user input from a selection of check boxes representing different events. If an event is selected and the user wants to add a schedule. Repeating panel rows are displayed for each event and a starting date date-picker component and an ending date date-picker component are displayed in each row.
what is a good way to store the dates selected to the event list? I also want the user to be able to add more events after they have selected some, and keep the date picker data for events that were previously selected.
Any components can take arbitrary tags to store what you like.
The other option is using session data. If you search the forum for tags and/or session data, you will find many examples. Of course if you need to store persistent and/or large data, you would want to use DataTables.
Let me know if I have misunderstood the core question.
The behavior I am after is to update a client side events list with with the date-picker values for the start and end dates of that event. I also want the user to be able edit the the events list without losing the data already stored in the list.
The larger pattern I am trying to find is as follows:
take some user input i.e strings, check-boxes, drop down fields, store those inputs in a list of dictionaries.
my_list = [{"input" : input1},{"input" : input2}]
drive the forms repeating panels self.items with this list.
3)take further user information from the repeating panel components i.e. date-picker and store that information back to the list.
4) write all that information back to the database on some event i.e button_click
I realized i needed a my_global_list, i find the items that have been removed from my_list and remove them from my_global_list - representing what the user has deselected. then i find the items that are new on my_list and add them to my_global_list with placeholder valuers for any other user input fields
no, my_list is rewritten every time the user inputs change. if the user deletes a previous input, then that input is deleted off my_global_list. If the user adds a new input then that input is added to my_global _list
So, as a result of the rewrite, is the data in my_list a strict subset of the data in my_global_list? Same dictionary keys and values?
I was looking for a way for you to maintain one list instead of two.
Trying to keep two things constantly in sync requires code, code that is sensitively dependent on the data layout and naming conventions. (And if it’s more than two things, it’s even worse.)