rothnic
rothnic2mo ago

Yeah, i'll take a look. I have 1 table

Yeah, i'll take a look. I have 1 table that shows items i've searched for with a button on that row. When you click that button, it copies that item over into state.items, which is what the 2nd aggrid table is displaying as the data source (eval). When you manually edit the values in the 2nd aggrid table it shows the updated value in the component (result[]), but state.items is still the same as before editing the data in table 2.
13 Replies
rothnic
rothnicOP2mo ago
@rubenf so, I was able to fix the app by creating a frontend script that listens to changes on d.newChange, which is the aggrid that is being edited and updated the column with the value from the new change in the state variable. I guess i could have maybe just copied over d.results into state.selectedOffers each time d.results changes, but this might give an idea what is going on. Previously, I didn't have to have this frontend runnable listening to changes on the aggrid. It just applied those to state.selectedOffers directly
No description
No description
rubenf
rubenf2mo ago
how did it apply those to state.selectedOffers ? what was the reactivity that worked before that doesn't anymore?
rothnic
rothnicOP2mo ago
table 2 was configured to display state.selectedOffers (second screenshot). Previously, when i edited values manually in the table, state.selectedOffers was mutated for me Now, i had to add the frontend script that listens for those changes (d.newChange) and manually updates the state.selectedOffers
rubenf
rubenf2mo ago
it was mutated without you assigning state.selectedOffers ?
rothnic
rothnicOP2mo ago
Yes
rubenf
rubenf2mo ago
It sounds like it was working by accident then maybe, as in it was assuming the variable was shared between the 2 potentially as it, it was relying on an implementation details of aggrid component that it was or not mutating the field in place or not if you have a very minimal reproduction I can see if we can improve the behavior and potentially support the old behavior
rothnic
rothnicOP2mo ago
The variable state.selectedOffers wasn't ever shared between the two. I had a row action on the first table (b_a) that would use a frontend script to add the data in the row into state.selectedOffers. Then table 2 was just displaying state.selectedOffers and applying edits to them
No description
rubenf
rubenf2mo ago
it's probably a structuredClone that we didn't do before
rothnic
rothnicOP2mo ago
Yeah, i just wasn't sure if it was as expected or not. I assumed, just because it worked before, that the point of aggrid was to provide an easily editable table of data without having to build a bunch of scaffolding around it to apply updates manually
rubenf
rubenf2mo ago
I mean yes the easiest we can make it, the better The easiest for me to answer is with an app.yaml with the expected behavior but if it can be very minimal that would be most helpful
rothnic
rothnicOP2mo ago
Sure, one sec, i think the core issue should be easy to reproduce
rothnic
rothnicOP2mo ago
@rubenf see here. I have the aggrid component, configured to show state.items, which is populated with data when you click the button. Then i have data displayed for state.items both as json data and a list of items, then the second column is the same thing but for table.result (which is the edited aggrid data). You'll see the state.items isn't updated when youedit the data, the age column can't be edited for some reason, and there is inconsistencies in the data being displayed when it changes.
rothnic
rothnicOP2mo ago
Also showing in the app editor interface that the configuration for the app components is having issues displaying the correct information when clicking between the two list components

Did you find this page helpful?