Changing format based on selected option item

Hi,

I am trying to change the format of the component when an option is selected. I've tried calling refresh() after changing the format but still the format does not seem to change.

onOptionChange = (args=> {
  // expected value of args.value are: cm, m and mm
  this.CustomVolumeRef.format = '###' + args.value;
this.CustomVolumeRef.refresh();
}

<NumericTextBoxComponent ref={ref => this.CustomVolumeRef = ref} format={`###mm`} cssClass="input-text-right" 
showSpinButton={false} name="CustomVolume"/>


Thanks.

1 Reply 1 reply marked as answer

JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team September 21, 2020 05:05 PM UTC

Hi Cedric, 

Thanks for contacting Syncfusion support. 

We have checked your query. We suggest you to take the value of change event as args.target.value to resolve the reported issue.


 

 this.onOptionChange = (args) => { 
    // expected value of args.value are: cm, m and mm 
    this.CustomVolumeRef.format = '###' + args.target.value; 
    //this.CustomVolumeRef.refresh(); 
} 


We have made a simple sample. Please find the sample in the below link. If we misunderstood your query, kindly revert with some more additional information or if possible try to reproduce the reported issue in the attached sample that will help us to validate the issue further and provide you a better solution from our end. 


Regards, 
Jeyanth. 


Marked as answer
Loader.
Up arrow icon