Posted 15 February 2021, 4:03 am EST
I am looking to add a state change in React when the ClipboardPasting event fires, so that the user sees a loading screen before the data is actually pasted into the worksheet (and the ClipboardPasted event fires). Is there any way to make the pasting delay a bit in the ClipboardPasting event handler so that the UI can have a second to repaint?React state changes between ClipboardPasting and ClipboardPasted
Posted by: daniel on 15 February 2021, 4:03 am EST
-
-
Replied 16 February 2021, 4:39 pm EST
Hi Danel,
You may override the paste action for the required functionality. Please refer to the following code snippet and let us know if you face any issues.
let old = GC.Spread.Sheets.Commands.paste.execute;
GC.Spread.Sheets.Commands.paste.execute = function () {
//show your loader here
setTimeout(() => {
old.apply(this, arguments);
//hide you loader here
}, 1000);
};
Regards
Avinash -
Replied 18 February 2021, 2:10 am EST
Hi Avinash,
We tried this, but now pasting from Excel doesn't work at all :( -
Marked as Answer
Replied 18 February 2021, 4:23 pm EST
Hi Daniel,
Could you please refer to the following updated sample and let us know if the issue still persists for you.
sample: https://codesandbox.io/s/red-framework-uwjgj
Regards,
Avinash