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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

getSelectedValue

Thread ID:

Created:

Updated:

Platform:

Replies:

127082 Oct 25,2016 08:56 AM UTC Oct 28,2016 09:21 AM UTC JavaScript 6
loading
Tags: ejDropDownList
Jon E
Asked On October 25, 2016 08:56 AM UTC

Hi

getSelectedValue seems to return the watermark text value if there is no selected item - is that behaviour correct?

Regards
Jon

Prince Oliver [Syncfusion]
Replied On October 26, 2016 07:07 AM UTC

Hi Jon,   
  
We were not able reproduce the issue. Please provide detailed information on your scenario along with code snippet or attach an issue reproducing sample.  This would help us to find the solution.  
  
Regards,   
Prince 


Jon E
Replied On October 26, 2016 08:19 AM UTC

Hi Prince
Ah OK.  I think this is down to the way that I have been clearing drop downs.  For various reason I handle cascading myself and when a parent changes I need to clear the chilkd drop down fields.  That is all OK but I am having issues with how to properly clear the children.  How do you clear the selected value AND empty the drop down of it's items?

Many thanks

Jon

Jon E
Replied On October 26, 2016 08:40 AM UTC

I've managed to clear the items by way of reapplying an empty array to the datasource in the absence of a full clearItems function.

Still need to work out the proper way to deselect all items.  There is an unCheckAll but no unselectall....

Prince Oliver [Syncfusion]
Replied On October 27, 2016 07:02 AM UTC

Hi Jon,   
  
Thanks for your update.   
  
In order to deselect all the selected items in dropdownlist, you can make use of selectedItemIndex property. Set value -1 to selectedItemIndex property using setModel method.   
  
function clearAll(args) {   
          target.setModel({ selectedItemIndex-1 });   
        }   
  
  
Another way of unselecting all items is by using clearText method.   
  
function clearAll(args) {   
          target.clearText();   
        }   
  
  
We have attached a Playground Sample for your convenience.   
  
Please let us know if you need more clarifications.  
  
Regards,   
Prince  


Jon E
Replied On October 27, 2016 12:51 PM UTC

Hi Prince,
Great thanks for that.  It has allowed me to complete that segment of the code now :)
Regards

Jon

Prince Oliver [Syncfusion]
Replied On October 28, 2016 09:21 AM UTC

Hi Jon,   
  
Most welcome.  
  
We are glad to hear your issue has fixed.   
  
Regards,   
Prince   


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.

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

;