Hello,
In supporting the bridging of binding between Aurelia 2.0 and Devextreme, I do the following (in the direction of AU→DxWidget):
propertiesChanged(bindableProp) {
...
const option = Object.keys(bindableProp)[0];
this.widgetInstance.option(option, bindableProp[option].newValue);
...
}
which works like a charm.
But I need to be able to filter out bindables that are value-adds (i.e. not on the widget itself but nevertheless add value to the widget through my wrapper). I was excited that I could do this:
/**
* @type {Boolean} Convenience bindable interpreted into `activeStateEnabled`, `focusStateEnabled`, and `hoverStateEnabled`.
*/
@bindable({ mode: BindingMode.twoWay, updateWidget: false }) static = false;
where updateWidget is a custom property of my own making, the absence of which by default would be interpreted as updateWidget: true since that is the predominant case in my wrappers.
My thought was that I could do this:
propertiesChanged(bindableProp) {
...
const shouldUpdate = bindableProp.updateWidget ?? true;
if (shouldUpdate) {
const option = Object.keys(bindableProp)[0];
this.widgetInstance.option(option, bindableProp[option].newValue);
}
...
}
But it looks like the bindable’s config doesn’t get passed as an argument to the change handler. This is true of individual handlers as well.
Without resorting to reflecting on the entire definition of the custom component, or calling #getBindables, is there a way to do this?