Closed DillonHammill closed 2 years ago
@sch56 I moved your request to a new issue where it is more visible. The current implementation returns the original data when the cancel button is hit: https://github.com/DillonHammill/DataEditR/blob/504d7faf89b6689255c1d797a8ccfc4d55f37b85/R/data_edit.R#L548
I implemented it this way because I needed this functionality in other packages. I could add a cancel
argument which would allow you to customise the return value when cancel
is hit by the user.
data_edit(mtcars, cancel = NA)
@sch56, I just pushed a fix to the master
branch on GitHub. Please pull it down and let me know how you go:
devtools::install_github("DillonHammill/DataEditR")
data_edit(mtcars, cancel = NA)
Note: Any return value is supported including matrices, data.frames, lists etc.
Hi @DillonHammill - I really want to know whether the user exited using the Done or the Cancel button. At present there doesn't seem to be any way to do this if they haven't actually changed some data. Would it make sense to not return the data when the Cancel is pressed? Or is there another way of determining this from the calling process?
The scenario for me is:
At present I can't distinguish 'Done' with no change from 'Cancel' - meaning back out.
Originally posted by @sch56 in https://github.com/DillonHammill/DataEditR/issues/3#issuecomment-1111715072