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

GridFieldLazyLoader causes alert when used together with GridFieldOrderableRows #285

Open
andreaslindahl opened this issue Feb 1, 2019 · 4 comments

Comments

@andreaslindahl
Copy link

If I add the GridFieldLazyLoader to a gridfield ($config->addComponent(new GridFieldLazyLoader());) and also add GridFieldOrderableRows I always get a "Are you sure you want to navigate away from this page?" alert when trying to leave the page, even if I haven't edited anything. I also noticed that the Save button at the bottom is highlighed as the page loads, as if I have unsaved changes, even when I don't.

Without the GridFieldLazyLoader everything works as it should. Or if I remove GridFieldOrderableRows. But they don't work that well together, it seems.

@andreaslindahl
Copy link
Author

Any news on this?

@robbieaverill
Copy link
Contributor

The news is that nobody has fixed it yet =) we'd happily review a pull request if someone gets to fixing it before we do!

@nickg87
Copy link

nickg87 commented Jun 19, 2019

Hi,
I'm new to SS and trying to add GridFieldLazyLoader to a grid in a tab.
The thing is that ajax is triggered not when i click the tab, but when the page is loading (main tab)
Any idea why? is this related to some JS that is not doing what was suppose to do?

@itspers
Copy link

itspers commented Mar 20, 2020

In case somebody still suffer from "Are you sure you want to navigate away..." – if you are using immediate save after drag, here is dirty fix:

$('.cms-edit-form').entwine({
            ChangeTrackerOptions: {
                ignoreFieldSelector: '.no-change-track, .ss-upload :input, .cms-navigator :input, .ss-orderable-hidden-sort'
            },
        });

When grid fully loaded by ajax, rows appear, and they have hidden new inputs – so form become changed and we have this message.
Idea is to tell form change watcher to ignore this hidden inputs, but as payment – you never have alert on grid sort, even if its really changed.

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

5 participants