We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

When the value is cleared by clicking 'X' icon, ej2Instances.value is null

Hi,

There is one in-place editor with following properties:

        :ref="ed" type="DropDownList" mode= "Inline"  data-underline="false" actionOnBlur="Submit" :model="repeatDropDownModel" :value="a" :showButtons=false emptyText="b"

     repeatDropDownModel :{
         dataSource:['a','b','c']
     }

When I clear the editor value by clicking 'X' icon in editing mode, 'b' will be displayed on the field, however, this.$refs.ed[0].ej2Instances.value becomes null. Should it be 'b' as well? 

And if I click the editor again, 'a' will be displayed instead of 'b' in the editing mode, I am confused.

Thanks,
Jzy

3 Replies

PO Prince Oliver Syncfusion Team February 25, 2019 12:43 PM UTC

Hi Jzy, 

Thank you for contacting Syncfusion support. 

The emptyText is applied to in-place editor when it is submitted with `null` or `undefined` or `empty string`. If you clear the DropDownList input data, null value is updated into dropdownlist alone (it is not reflected to In-place Editor’s value property). After submitting the editor, value property is set as null and emptyText will set to DOM. 

Refer below documentation link for more details 


We have prepared sample for your reference, check the below link 


In the above sample, open an editor then press clear icon in dropdownlist component, now you can see the input is cleared. Then click outside of In-place Editor element, value will submit because sample configured with actionOnBlur as Submit. emptyText property value of 'Select value' is now set to DOM, but it is not updated in editor value property. if you open the editor again, the last  updated value in the value property will be assigned in the dropdown's input 

Regards, 
Prince 



JZ Jzy February 27, 2019 02:43 AM UTC

Hi,

Thank you for your help. 

So I should set emptyText value to be 'select one value' instead of one value of the list directly. 


PO Prince Oliver Syncfusion Team February 27, 2019 06:00 AM UTC

Hi Jzy, 

Most Welcome. We are glad to help you. Yes, the emptyText property behave like as placeholder here. 

Regards, 
Prince 


Loader.
Live Chat Icon For mobile
Up arrow icon