Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REACT] StateProvider doesn't keep column sizes or page reload #6618

Closed
chuckn0rris opened this issue Apr 19, 2023 · 10 comments
Closed

[REACT] StateProvider doesn't keep column sizes or page reload #6618

chuckn0rris opened this issue Apr 19, 2023 · 10 comments
Labels
bug Something isn't working forum Issues from forum high-priority Urgent to have fixed large-account Reported by large customer OEM OEM customer premium
Milestone

Comments

@chuckn0rris
Copy link

chuckn0rris commented Apr 19, 2023

Forum post

Demo attached.
If you move splitter and reload - position will be properly restored. If you resize column and reload - size won't be saved.
Works well in vanilla.

Bryntum-demo-2023-04-18-001.zip

@chuckn0rris chuckn0rris added bug Something isn't working premium forum Issues from forum large-account Reported by large customer OEM OEM customer labels Apr 19, 2023
@matsbryntse matsbryntse added the high-priority Urgent to have fixed label Apr 19, 2023
@FlowIT-JIT
Copy link

@matsbryntse Would it be possible for you guys to commit to having this issue resolved for the next patch version of 5.3 ?

@matsbryntse
Copy link
Member

Yes, we'll try our best!

@matsbryntse matsbryntse added this to the 5.3.4 milestone Apr 21, 2023
@FlowIT-JIT
Copy link

Thanks a lot, @matsbryntse

@jsakalos
Copy link

I took the above sample for testing, changed the version of Bryntum libraries to 5.3.2 in package.json and started the app with npm i && npm start. Then I've deleted existing (probably stale) local storage and the columns' widths are restored on reload as expected. See the screencast:
state

@FlowIT-JIT
Copy link

FlowIT-JIT commented Apr 21, 2023

@jsakalos Thank you for investigating.
I'm not entirely sure why the bug report started focusing on column widths since that was not what I reported. Perhaps to simplify things. But please see the original forum post. When we re-create Gantt (use the [Create new Gantt instance] button), customizations done to the order of columns are reverted - and possibly other view settings as well, I don't remember. I have just verified that the problem is still present with version 5.3.3.

@FlowIT-JIT
Copy link

I have attached a video demonstrating the problem with version 5.3.3.
Bryntum-2023-04-21-001.m4v.zip

@jsakalos
Copy link

Thanks for the info, I'll check that too.

@jsakalos
Copy link

@FlowIT-JIT, so I have finally cracked it. What's going on behind the scene is that columns configuration objects are converted to records for ColumnStore and their ids are auto-generated, if not provided. So when we reload the page, the column ids generation starts at zero. However, when we destroy and re-create the instance, the id generation continues from the previous instance, effectively unlinking the columns from the saved state.

The solution is simple: give your columns' configs ids, for example:

            "columns": [
                {
                    "text": "",
                    "type": "wbs",
                    "id":1
                },
                {
                    "type": "check",
                    "text": "Manuel",
                    "field": "manuallyScheduled",
                    "id":2
                },
                {
                    "type": "name",
                    "text": "Titel",
                    "field": "name",
                    "width": 350,
                    "id":3
                },

and it will work. I will also create a ticket to check whether we could improve the auto-generation of ids logic.

@isglass
Copy link
Contributor

isglass commented Apr 26, 2023

Replaced by #6646

@isglass isglass closed this as completed Apr 26, 2023
@FlowIT-JIT
Copy link

@jsakalos Thank you so much for providing a fix 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum high-priority Urgent to have fixed large-account Reported by large customer OEM OEM customer premium
Projects
None yet
Development

No branches or pull requests

5 participants