CHANGE EVENT

hello,
I cannot recover the value of my numerictextbox during the modification.
is there an event to recover the value during the modification and not at the exit of the numerictextbox?



 <ejs-numerictextbox  placeholder="Montant *"  formControlName="montant" floatLabelType="Always"></ejs-numerictextbox>


  this.costabForm.get('montant').valueChanges.subscribe(
      (montant:any)=>{
        let equivalent = montant*this.costabForm.get('taux').value
        let equivalentR = montant*this.costabForm.get('tauxR').value
        this.costabForm.get('equivalent').setValue(equivalent);
        this.costabForm.get('equivalentR').setValue(equivalentR);

      }
    )

3 Replies

SP Sureshkumar P Syncfusion Team May 27, 2020 09:57 AM UTC

Hi bassaramani, 
 
Greetings from Syncfusion support.  
 
Based on your shared information, w suspect that you want to get the component value when input the value into numerictextbox component. We suggest you bind the input event into the component element to achieve your requirement.  
 
Kindly refer the code example. 
[component.html] 
 
<!-- Render Numeric Textbox --> 
            <ejs-numerictextbox #numeric value="10" (created)="onCreate($event)"></ejs-numerictextbox> 
 
[component.ts] 
@ViewChild('numeric') 
    public numericObject: NumericTextBoxComponent; 
    constructor() { } 
    onCreate() { 
        this.numericObject.element.addEventListener("input"this.inputChange.bind(this)); 
    } 
    inputChange(args) { 
        console.log(this.numericObject.element.value); 
    } 
 
 
We have created the sample based on your requirement. please find the sample here: https://stackblitz.com/edit/angular-woyojt-yewby3?file=app.component.html  
 
Regards, 
Sureshkumar P 



BA bassaramani May 27, 2020 12:01 PM UTC

hi Sureshkumar,
thank you very much for your help.


SP Sureshkumar P Syncfusion Team May 28, 2020 05:40 AM UTC

Hi Bassaramani, 
 
Thanks for your update. Please get back to us if you need any further assistance on this.  
 
Regards, 
Sureshkumar P 


Loader.
Up arrow icon