Hi, I want to show dialog confirm on paste data.
Confirm dialog have 2 button (Cancel/OK) (Currently, I use Element UI for showing dialog)
Click Cancel: Do not paste data
Click OK: Paste data
How can I do that ?
Thanks In advance !
https://jsfiddle.net/TonyNguyen001/k345ehnc/17/
Confirm before paste data
Hi @khanguyen96
in your condition for the Cancel
button you need to return false
in the beforePaste
hook
beforePaste: function(){
return false
}
The function beforePaste
do not waiting for click button OK/Cancel. It’s alway paste data. You can check at this link
https://jsfiddle.net/TonyNguyen001/k345ehnc/20/
Hi @khanguyen96
you need to disconnect the Handsontable paste
by returning false
. Then you need to pass the data inside the “Ok” part, like here https://jsfiddle.net/m83wsndt/8/ with the use of populateFromArray
method.
1 Like
Thank you so much, it works perfectly !
I’m glad to hear that it works for you. If you would need anything else please feel free to open a new ticket or send me an email to support@handsontable.com