I'm develping an Excel addin with office.js and I want to track row change events.
I'm fetching data from a DBMS with technical Ids but I don't want to print ids into the sheet.
My main issue is to identify univocally the edited row: when user perform row sorting I'm loosing any reference.
I have tried several approaches:
Range
excel.binding row by row (a binding for each row)Table
excel.binding on entire dataset- A combination of handlers such as:
- BindingDataChanged
- TableDataChanged
- Named items
Below a gist that can be directly imported into ScriptLab with the first two options looking the most promising https://gist.github.com/webartoli/86a19ffa0e683aa1d204eabaaeb09dd1
Can anyone help me in being able to uniquely identify a row in events ?
Repro steps:
- Click a button to create dataset and set handlers
- Sort the second column ascending: the first rows becomes id=5
- Edit the first row
How can i get from events that row with id=5 is edited without printing id column on sheet ? I except this from "binding" feature but I cannot find a way.