I have in an angular component this piece of code:
@Output() fixPercentChanged = new EventEmitter<number>();
And I have this event:
fixChanged(e) {
setTimeout(() => {
let fix = e.component.option('value');
this.fixPercentChanged.emit(100 - fix);
}, 100);
}
This event is binded in the markup to a keydown event of an input element:
<dxi-item dataField="fix" [label]="{text: 'Fix %'}" editorType="dxNumberBox"
[editorOptions]="{format: '#,##0.00\'%\'', onKeyDown: fixChanged, valueChangeEvent: 'keyup'}">
<dxi-validation-rule type="required" message="A mező kitöltése kötelező"></dxi-validation-rule>
</dxi-item>
It gets fired, but the console says, that fixPercentChanged
is undefined. If I print this
to the console, I get the dx-number-box
input element. this
should refer in this case to the component itself. How to rewrite the function in oder to correct this?