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

Prevent Losing Data in Edit Mode #1011

Open
azazlhr opened this issue Jan 25, 2018 · 5 comments · May be fixed by #1015
Open

Prevent Losing Data in Edit Mode #1011

azazlhr opened this issue Jan 25, 2018 · 5 comments · May be fixed by #1015

Comments

@azazlhr
Copy link

azazlhr commented Jan 25, 2018

Hi,
I've searched through the Google, and here in git repo as well but couldn't find solution to following UX problem.

Lets say, when editing is enabled on the grid and user can click on a row item and start modifying. Now if user accidentally clicked on another row all unsaved changes will be lost.
Is there a way to prompt user to save changes before moving to another row?

Thank you for sharing the great work.

devel0 pushed a commit to SearchAThing-forks/jsgrid that referenced this issue Jan 28, 2018
@devel0
Copy link

devel0 commented Jan 28, 2018

this change should do the trick by auto updating edited row before activate edit on another one

@azazlhr
Copy link
Author

azazlhr commented Jan 29, 2018

@devel0 , thanks for the update. But I think it's equally risky to save unsaved changes forcefully. This may result in saving accidental changes that user didn't mean to save. So I think showing a prompt would be a safe approach.

@nabeelriaz1001
Copy link

There is no callback when user clicks + button to insert a new row.

Scenario:

  1. User edits a row, forgets to click save.
  2. Clicks on + icon to insert a new row.

I want to be able to show a prompt here.

@devel0
Copy link

devel0 commented Jan 29, 2018

It wouldn't bad to have ability in choose desired behavior by some grid config variables defaulted to safer approach ( eg commitMode = prompt ) others value could be control ( by click on control accept icon ) or none ( the current one ). Or the one I proposed with PR would another type more auto

update
feature added in pr ( #1015 )

autocommit: false,
confirmAutocommit: true,
autocommitConfirm: "Save changes?",
  • autocommit : if false (backward compatible) it does a cancelEdit
  • autocommit : if true it shows a dialog to ask save changes or not ( confirmAutocommit === true ) or it save silently ( confirmAutocommit === false )

@vyasrohit1983
Copy link

in the update controller I am showing the server side validations (error) messages to user, so when I showing this message to user, I want to keep that row enable for editing .

Please suggest what changes needs to do

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

Successfully merging a pull request may close this issue.

5 participants