Posted 5 March 2025, 11:38 am EST
FlexSheet has copying and copied event but how can I detect event cutting and cut(without addEventlistener keyup for hostElement of FlexSheet to check keycode 88)
Forums Home / Wijmo / General Discussion
Posted by: nam2.nguyen on 5 March 2025, 11:38 am EST
Posted 5 March 2025, 11:38 am EST
FlexSheet has copying and copied event but how can I detect event cutting and cut(without addEventlistener keyup for hostElement of FlexSheet to check keycode 88)
Posted 6 March 2025, 2:56 am EST
Hi nam2.nguyen,
For now, there is no specific event for the cut operation, internally the cut operation is tracked using the ‘flexSheet._isCutting’ property. You can use this property if you want, please note that this is an internal property it may give typescript warnings and it’s value must not be modified manually to avoid any unexpected results while pasting.
Another alternate method will be to handle the ‘keydown’ event on the flexSheet host element as you suggested.
Here’s a sample for your reference - https://jscodemine.mescius.io/share/59bN7zo3f0OvanBeOhbAbg/
Regard
Posted 6 March 2025, 2:58 am EST
Thank you for your reply. I have the same question but it’s about detecting event of deleting cells on FlexSheet (with Delete key)
Posted 6 March 2025, 3:22 am EST
Hi Nam Nguyen,
For the delete operation, you’ll have to handle the ‘keydown’ event on the flex sheet. Here’s the updated sample for the same - https://jscodemine.mescius.io/share/WJZx6AGt6EaDcLXb3_Mwtg/
In case, you face any issues, please let us know.
Regards