devextreme-angular icon indicating copy to clipboard operation
devextreme-angular copied to clipboard

Widgets events

Open AngelVlc opened this issue 8 years ago • 2 comments

  • Specify the version of the devextreme-angular and devextreme packages you are using. devexteme version: 17.1.7 devextreme-angular version: 17.1.7

  • Specify the type of the issue (check one with "x"): [ ] bug Report [ ] feature request [ ] support inquiry

Hi, if I handle a widget event in the template (i.e. onKeyUp): <dx-text-box #dxTextBox (onKeyUp)="firstHandler($event)"></dx-text-box> And by code: dxTextBox.onKeyUp = secondHandler;

I get both handlers working. But if I remove the template handler then the code handler doesn't work.

I can solve it like this but I'd like to know why this is necessary and if I can do it in another way without modiying the template: <dx-text-box #dxTextBox (onKeyUp)="void"></dx-text-box>

Thanks!

AngelVlc avatar Jan 11 '18 17:01 AngelVlc

onKeyUp is an event, i.e., it's an output. It's incorrect to assign a function to it. You need to subscribe to an event to handle it in code:  

this.txt.onKeyUp.subscribe((evnt) => {
console.log(evnt);
});

GoshaFighten avatar Jan 17 '18 20:01 GoshaFighten

This issue is closed because of being inactive. If you need further assistance, leave a comment here.

GoshaFighten avatar Jan 30 '18 18:01 GoshaFighten