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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to re-initialize dropdownlist's value

Thread ID:

Created:

Updated:

Platform:

Replies:

147122 Sep 2,2019 11:18 AM UTC Sep 3,2019 10:54 AM UTC React - EJ 2 1
loading
Tags: DropDownList
Albert
Asked On September 2, 2019 11:18 AM UTC

I have a report filter that has a dropdownlist and user can select a row from list.

It's possible that user clicks on "clear" button to delete all selected values in the filters, the problem that exists is this that we can not make the value of dropdown value to null as before the user has selected anything.

Please advice how we can achieve this.

Thanks in advance


Ashokkumar Balasubramanian [Syncfusion]
Replied On September 3, 2019 10:54 AM UTC

Hi Afshin, 
 
Greetings from Syncfusion support. 
 
We have checked the reported requirement. We would like to let us know that, by default dropdown list value is null. When you clear the value using clear button then input element goes empty and dropdownlist value is null. If you need to set the dropdown list value is null by programmatically, then take the instance and set the value for value property is null as mentioned below. 
 
<DropDownListComponent id="country" ref={(dropdownlist) => 
    { this.listObj = dropdownlist; }} dataSource={this.searchData} filtering={this.onFiltering.bind(this)} filterBarPlaceholder='Search a country' allowFiltering={true} fields={this.fields} placeholder="Select a country" popupHeight="220px" showClearButton="true" created={this.onCreated.bind(this)} /> 
 
this.onCreated = (e) => { 
     this.listObj.value = null; 
} 
 
In the filters if you have typed some characters and using clear button to clear the values in inputs, all the search character will be cleared.  
 
 
If we misunderstood your query, please revert more details to us it will help to validate further. 
 
Regards, 
Ashokkumar B. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon