JavaScript API for Office: How to get currently selected cell identifier? -
i've come conclusion functionality not available in javascript api office v1.1, thought i'd make sure here first.
i identifier (ie. "a1") of selected cell, cannot find in api supports this. find odd seems arbitrary requirement , can set current selection using identifier document.gotobyidasync
method.
does know if there method access information?
one hacky way might able follows:
- add binding region of sheet care about
- add change handler binding
- call getselecteddataasync , store value
- call setselecteddataasync arbitrary string. trigger change handler.
- in change handler's callback, data binding
- search string , calculate identifier index
- restore data
hope helps, might little fragile though.
edit: looks bindingselectionchanged callback gets event position information (startrow, startcolumn, rowcount, columncount) no need hack above :)
Comments
Post a Comment