It's just IsSelected on the visible property of the child. I've solved that in one of the versions of my app, but the last thing seems to be the patch. I know there's some "trick" to getting the child data values into some array or table that will persist when I click the button for the patch, because if I display them with a notify, they all have null values at that point but I can clearly see in the grid there are values. I know it's the groupby now but I seem powerless to ungroup that so that I can get to the data.
I tried that but the problem is I don't know where to Ungroup. In the examples I've seen they mostly show only the Ungroup statement prior to the patch. But when I do that I get an error that it doesn't recognize "Data" which is the name I put the grouped data into.
So my GroupBy is in the items property of the parent gallery, (with an AddColumn and Filter and Sort. Everything displays and behaves well.
When I change a value, it's OnChange has Collect(getAllKids,{cID: ThisItem.ID}); and in the button OnSelect to perform the patch which uses a ForAll loop on that ID and that works. but when I added another collection to the OnChange Collect(getKidsData,{cStatus: ThisItem.Status}); and I displayed that with a Notify on the button before the patch, cStatus was null.
So clearly this is not the way to go.
Here's what I want it to do:
OnChange of the fields in the grid, Collect the ID and separately the ID, Status, Status.Value, anyothercolumn, anyothercolumn.Value ...)
So then I use the first collection of just IDs of rows with at least one change, do a LookUp on the datasource based on those IDs (and that works)
Then use the list of distinct IDs as a ForAll(
and then an inner ForAll that match the ID on the outer ForAll
Either sort in Descending date/time order (I plan to put a timestamp on all changes while collecting) and process only the last patch for that ID because it will hold the most recent version of what's to be patched.
So the data rows that I collect for the changes would look like
ID, Field1, Field1Value, Field2, Field2value, etc...
and here I'll give you what the actual rows would look like:
Assuming an ID of 1, and a Status, CourseName, Notes each one blank or having an old value and blank timestamp
1, <blank>, <blank>, <blank>, <blank>
1. Approved, <blank>, <blank>, 9/21/2023 13:25:33
1, Approved, "History 101", <blank>, 9/21/2023 12:25:35
1, Approved, "History 101", "These are my notes blah blah", 9/21/2023 12:25:39
So, in this scenario where all 3 fields are being updated (plus a timestamp) only the last one will be patched with the most recent timestamp.
and then return to the refreshed grouped gallery
The ID part is working as I was able to find the proper syntax on the internet. But sadly, none of the fields have data because I haven't ungrouped. AND I'm not sure where in my app to ungroup because when I tried that I got the following error:
On the statement Ungroup(myCollection, "Data"); The error is "The specified column 'Data' does not exist. but that is the name of the table of the non-grouped data.
and, one more thing, every example I see from the experts show this scenario with the original GroupBy done on a button, mine is in the Items property. So the scope of this is unclear and obviously wrong since the Data is always null because, I think, I haven't ungrouped the data.
Sorry for such a wordy explanation but truly, I've been working on this for weeks and am still struggling.
Thanks in advance.