Pending Review
Last Updated: 23 Apr 2018 17:51 by ADMIN
Kevat
Created on: 19 Mar 2018 16:49
Category: Kendo UI for Angular 2+
Type: Feature Request
2
Allow binding to keyup event for textboxes
There are many use cases of functions which need to run on keyup for a textbox. The most common use case is probably handling enter when the user is focused on the textbox and hits enter. 

Please create a keyup event emitter for the Textbox, MaskedTextBox and NumericTextBox components.

NOTE: The dropdown for "Category" required to add this idea does not have "Inputs" as an option; the category "New Component" was selected instead.
1 comment
Kevat
Posted on: 19 Mar 2018 17:03
For now, I resorted to finding the input tag for the textbox on page load using jQuery. The following approach may not work for dynamically generated textboxes (you many need to hook into some part of the Angular lifecycle instead of doing this on page load):



component:

export class MyComponent implements OnInit {

	constructor(private renderer: Renderer2) {
	}
	
	public ngOnInit(): void {
		this.renderer.listen(
			'window',
			'load',
			({ target }) => {
				$("input#myTextBox").keyup(() => { alert("keyup") });
			});
	}
}


-------------------------------------------------------------------------

template:

<kendo-maskedtextbox id="#myTextBox"></kendo-maskedtextbox>