On page load, I create a large array called calendarListRaw and put it into Page Data, then filter a sublist for past events to show in the studentContainer, this works fine.
While the dynamic list seems to be filtered correctly with the new sublist. I am saving the dynamic list before and after into a table, and the array is correct (before there are only past values, after there are only future values). The code seems to be fine.
Yet, on the UI I still see objects from the old sublist.
Is there something I can do to troubleshoot? I changed the block IDs yesterday. While the names changed dynamically in the code itself, I suspect this may have something to do with it.
Thanks Mark. I am not well versed in using the browser’s inspect tool, I can never find the printouts in there for some reason. That is why I am saving the values to my test table “errors”. And the values of messagingList seem to be transformed correctly by the code.
Very strange @mark-piller , still not working correctly. I am now using data binding, and the array is working. You can see the printout in the console log starts with students Bella, Ben, Kaitlin as it should. The UI keeps 4 ‘old’ objects at the top, before starting with Bella, Ben, Kaitlin.
Specifically, might this one below be an issue? Under certain conditions, I change the background to orange. My assumption is that when these are not in the dynamic list, they don’t appear
Try to experiment with it and assign an empty list to the studentContainer property in Page Data. This should result in all the elements in the UI being removed. If some of them are still there, the data must be coming from somewhere.
@mark-piller It is strange. When I replicate the issue on the backend (where I feel more comfortable), my logic works perfectly, filtering a large list of 45 objects that contains objects with both past and future start_times, into a sublist with only future start_times.
The data must be coming from somewhere. The problem is not in the click event logic. Try this:
instead of data binding to the studentContainer property right here:
@mark-piller I made it so that I print both the total list of calendar events (past and future) as well as the current sublist in the studentContainer.