This is a migrated thread and some comments may be shown as answers.

NumericTextBox 'onClick'?

1 Answer 327 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 1
Lee asked on 08 Dec 2017, 02:26 PM

Is there a way I can bind to the click event of the control? Doing the following somewhat works, but requires a double click. It seems the first click is being silenced or aborted by the control internally.

   this.$el.find(".textbox-debit").click(function() {

                    console.log("hi!");
                });

                this.numDebit = this.$el.find(".textbox-debit").kendoNumericTextBox({
                    format: "c"
                }).data("kendoNumericTextBox");

 

Thank you!

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 12 Dec 2017, 07:26 AM
Hello Lee,

The described behavior is expected. Internally the numeric text box uses two inputs, one for the formatted value and another for editing the value. Initially the input with formatted value is displayed, once the input is focused the formatted input is hidden and the editor input is displayed.

Basically the event is attached to the editor input, so the click is fired after the numeric is focused (in edit mode). For better understanding, please refer to the following screencast:


A possible workaround is to attach the same handler to both focus and click events.


Regards,
Georgi
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
NumericTextBox
Asked by
Lee
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or