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

Gridfield pagination shows changed navigation warning without changes #482

Closed
matt-in-a-hat opened this issue Apr 11, 2018 · 4 comments
Closed

Comments

@matt-in-a-hat
Copy link

If you use the pagination buttons within the default model admin gridfield then attempts to navigate away or edit a row will show the warning message:

Are you sure you want to navigate away from this page?
WARNING: Your changes have not been saved.

Without anything being edited, just press the next page button and it then marks the form as changed.
image

This is happening on SS 4.2.0, see an example set up here https://github.com/mediasuitenz/silverstripe-modeladmin-example

From what I can see, it looks like it might have been happening since #362, and removing the self.trigger('change'); line does seem to fix it for me. I'm not sure I understand why that was added though @flamerohr ?

@flamerohr
Copy link
Contributor

the trigger is needed to update some state inside the GridField, I don't remember what but something else breaks when it's not there.

Also, something else is wrong and you're seeing the popup as a symptom of that, the trigger change isn't the root cause of the issue.

@tractorcow
Copy link
Contributor

Possibly related to silverstripe/silverstripe-framework#7997

I think we just turn of change tracking for gridfield (outside of detail form that is).

@flamerohr
Copy link
Contributor

it's related :)
I don't think turning off change tracking for gridfield would be a good idea, unless you find a solution which is opt-in for particular fields.
If there's inline editing for the GridField then you'd want those to trigger the change tracker (thinking userforms)

@ivoba
Copy link

ivoba commented Feb 25, 2019

I still have this in SS4.3.
Paginating a Gridfield will cause the "Are you sure you want to leave the page" to pop up.

Sorry not an issue of silverstripe-admin but of symbiote/silverstripe-gridfieldextensions, see symbiote/silverstripe-gridfieldextensions#286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants