Toggleable colomn fails after making it visible again
I have some code that hides and unhides colomns because I have a inline edit mode.
Yet when I have switched from Display mode to Edit mode, it shows the toggelable colomns from the dipslay mode instead of the edit mode.
When I switch back to Display mode I see the toggleable colomns from Edit mode, so it is always a state behind, whenever I refresh or when I simpely search something in the searchbar or whatever update event I do, it fixes the toggelables:

10 Replies



First load it is correct, but after switching it messes it up and will always be one "state" behind
1st screenshot is initial state
2nd screenshot is edit mode with display mode toggelables
3th screenshot is display mode again with edit mode toggelables
Does someone know how to fix this issue?
Nope... not quite following here, you say it's always a state behind? But your screenshots shot it right?
Only the first screenshot is right, (the state it is when i load the page for the first time, i can make more clear screenshots tomorrow
Alright so:
First of when I visit the page applications i get this:
You can see the 3 columns named Name, Created At and Updated At
This is display the display mode because you cant inline edit

This is the edit mode:
You can inline edit all the lines, i have renamed name to example for only the inline edit mode so can can clearly see what i mean with previous state in the toggelables
Note: I have added toggleable for the example column in next screenshots, its it currently off because of the bug and forgot to change it before making this screenshot

So back again, i have refreshed my page, first time visiting the application page.
You can see i have the toggleables Name, created at and updated at, which is correct

Now when activating the edit mode, when looking at the toggleable options, I still see name, created at, updated at, while there should be only Example

Finally, when going back to display mode it only shows example, while name, created at and updated at should be visible
---
Thats why I call it "always one state behind" because you can see the toggleables from before switching the mode

Right got you, the toggleables is going to be behind in that scenario because it's handled on boot. Toggleable normally would never change the columns are related to the data. I would usually recommend a separate list page for editing which could render differnet able parameters. Maybe on the dit mode, instead of toggling to refresh the data do a page redirect with a query string to enable edit mode which will cause 1 redirect, but ensure everything lines up correctly?