Posted 22 February 2018, 9:08 am EST
Hi. Is there a way to know when a comment gets focus? Because I need to disable some buttons in a toolbar once the comment gets focus and couldn’t find an event to handle this.
Thanks.
Regards.
Forums Home / Spread / SpreadJS
Posted by: lpagliaro on 22 February 2018, 9:08 am EST
Posted 22 February 2018, 9:08 am EST
Hi. Is there a way to know when a comment gets focus? Because I need to disable some buttons in a toolbar once the comment gets focus and couldn’t find an event to handle this.
Thanks.
Regards.
Posted 22 February 2018, 9:23 am EST
I managed to found a way by doing this:
commentEditor = document.querySelector('textarea.gc-comment-editor')
commentEditor .onfocus = () => console.log('focus')
That every time I give focus to a comment it logs ‘focus’ on the console.
Is there other way of doing this through SpreadJS events?
Posted 23 February 2018, 9:31 am EST
Hello,
Comment class with Spread.Sheets has only CommentChanged, CommentRemoved and CommentRemoving events.
http://help.grapecity.com/spread/SpreadSheets11/webframe.html#SpreadJS~GC.Spread.Sheets.Events.CommentChanged.html
http://help.grapecity.com/spread/SpreadSheets11/webframe.html#SpreadJS~GC.Spread.Sheets.Events.CommentRemoved.html
http://help.grapecity.com/spread/SpreadSheets11/webframe.html#SpreadJS~GC.Spread.Sheets.Events.CommentRemoving.html
The above solution should work fine for getting focus to comment box.
Thanks,
Deepak Sharma