How will the form fields be populated? If you click on {{currentRow}}, does it show the right object:
I might be missing something! But this set up appears to be working on my side. Once you expand a row, the form data for that row will show under form1
The strange behavior is the state of the form has new arrays added to it when rows are expanded. Is each data set added in the state the data in the form for the expanded row? If that is the case, why wouldn't the form already have a set of data for each row in the table before they are expanded?
I found a different approach to accomplish what I was initially trying to do that brought me here, but would still like to better understand how the state evolves for components in expandable rows. The initial use case was simply to nest extended details for each record under the more critical aspects of the record, allowing users to access that information without having to "scroll right" forever. I had thought I would be able to create a JSON object in the query that could then be expanded, but found the nesting logic and states got complex.
Got it! I believe that part is expected (once expanded, it gets added to the component's state & will stay there even if collapsed) I'm glad you were able to move forward!
I added this thread to an internal ticket for our engineering team to review where we're tracking feedback on the expandable rows data structure.
@Tess
In addition to programmatic access to collapsible state, simply persisting the value when the table is hidden would be a massive gain.
We have a project based around a table, and the workflow requires frequent moving away from the table to a different view.
We've had to bend over backwards in order to keep the state of collapsed/expanded, so when the user comes back to the table, they don't need to re-expand the multiple groups each time. We implemented a rather inelegant hack; but it's caused some performance degradation, which we can't really afford.
Thank you for the context, @jg80! I shared this directly with the team that owns the table. This request is still being reviewed, so I don't have an update yet, but I'll keep this thread updated with any changes
However, the moment I select a cell in the second row, it adds index 0, and the data that should go in Key 1 goes into Key 0. In fact, the data that it is added to key 0 is correct, as it belongs to the first row.
Hey @MiguelOrtiz! Thanks for reaching out in office hours I think I see what's happening here.
The first part of your logic looks good. We're filtering invoices_getData for each row of the list view
However, the selectedCell logic is causing confusion because the selected cell could be in a different row. We need to modify this logic to only filter if the selectedCell is also in the current row.
As I was testing this theory, I seemed to also run into a race condition where the listView didn't always have the updated table values. For this reason, I added a temporary variable to track the selectedCell. I'm not sure that this is a sustainable approach, since it adds another layer of JS logic, but it seems to be working ok with my data. Hopefully, it helps give you an idea of how you might go about this use case:
Variable:
Event handler to set the variable:
List logic modified to check if the selected cell is also in the currentRow + modified to reference the temporary variable:
Thank you! It does work. And actually I don't see this behaviour of showing all items if no month has been selected. For reference, I leave here my final Data source code for the list view