Background
I am writing a sidebar app for Excel 2013, and I have a wrapper function which updates the view of the sidebar. I need to trigger that function (and so trigger an update of the view) from multiple events, one of which is when the data in a bound area changes.
The problem I'm having is that I need to pass along a variable to that wrapper function. It needs data which I want to be able to save in a Setting and then load just once.
Code
Current Code:
Office.select("bindings#"+bindingID).addHandlerAsync(Office.EventType.BindingDataChanged, onBindingDataChanged);
function onBindingDataChanged(eventArgs) {
searchThroughData(eventArgs.binding.id);
}
function searchThroughData(bindingID) {
//repaint view
}
The above works to trigger the repaint. But it doesn't include the passed variable. What I'd expect is for the code to be something like this:
Attempted, Doesn't Work:
Office.select("bindings#"+bindingID).addHandlerAsync(Office.EventType.BindingDataChanged, onBindingDataChanged(eventArgs,data));
function onBindingDataChanged(eventArgs,data) {
searchThroughData(eventArgs.binding.id,data);
}
function searchThroughData(bindingID,data) {
//repaint view
}
This doesn't work, however.
Question
Any ideas how I can pass along this variable?