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

How can I get check items (in JavaScript)?

Hi,
How can I get the checked items list ?
I would like to display the checked items in JavaScript alert.

I tried some codes but it doesn't work for me:

var oDevices = $("#<%=DevicesDropDownList.ClientID%>").data("ejDropDownList");

alert(oDevices.getChecked()); //failed

alert(oDevices.getCheckedItems()); //failed

for (var i = 0; i < oDevices .model.selectedIndices.length; i++) {
     alert(oDevices.model.selectedIndices[i].checked); //failed
}

Thanks for help.
  Tomer

3 Replies

KR Keerthana Rajendran Syncfusion Team August 15, 2017 05:45 AM UTC

Hi Tomer, 
 
Thank you for contacting  Syncfusion support, 
 
Way 1: We suggest you to use getSelectedItem method to get the selected items. You can use getSelectedValue method  to get the value of selected item 
 
Way 2: You can also use change or checkChange event to get the value or text of selected items in arguments 
 
We have prepared a sample based on this. Please refer to the below given link 
 
 
 
Regards, 
Keerthana. 



TO tomer August 15, 2017 06:16 AM UTC

Thank you,

Works great !



KR Keerthana Rajendran Syncfusion Team August 16, 2017 04:39 AM UTC

Hi Tomer,  
Thanks for your update. We are happy to hear that our suggestion resolved your issue. Please get back to us if you require any further assistance on this. We will be happy to assist you 
Regards, 
Keerthana  


Loader.
Up arrow icon