Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
How to determine if item is selected on client-side.
posted

On DropDownClosed client-side event of the WebDropdown, I need to know how to get the Web dropdown's selected item collection and get its text, value and index. I am not using the check boxes in the drop down, but I allow multi selection.

1. What would be the method to get the selected items collection in javascript.

2. What is the property of the item, that tells if the item is selected.

Thank you.

Parents
No Data
Reply
  • 24671
    Verified Answer
    posted

    hi,

    To get array of currently selected items:

    dropDown.get_selectedItems(); // works for both single and multiple selection

    To check if an item is selected or not:

    item.get_selected(); // returns true or false if item is selected or not, respectively

     

    To get any item from the current collection of dropdown items:

    dropDown.get_items().getItem(i); // where "i" is the item index. 

    Hope it helps,

    Angel 

Children