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 to get value for id, text or value fields?

Hi Syncfusion team,

The controls HTML5/Javascript are wonderful.

I have implemented ejListBox control
based on this sample

How do I get the value of the id or value property?

This is my code:

<script type="text/javascript">
   var target;
   var empList = [
               { text: "Erik Linden", eimg: "3", desig: "Representative", country: "England" }, { text: "John Linden", eimg: "6", desig: "Representative", country: "Norway" },
               { text: "Louis", eimg: "7", desig: "Representative", country: "Australia" }, { text: "Lawrence", eimg: "8", desig: "Representative", country: "India" }

   $(function () {
         dataSource: empList,height:"240",
         selected: "Onselected",
         fields: { id: "eimg", text: "text", value: "eimg" }
         template: '<div><img class="eimg" src="../images/Employee/${eimg}.png" alt="employee"/>' +
                       '<div class="ename"> ${text} </div><div class="desig"> ${desig} </div><div class="cont"> ${country} </div></div>'

   function Onselected(args) {     
      // Here, I need to get the values for id/value properties

Thanks for your help

1 Reply

ES Ezhil S Syncfusion Team May 4, 2015 10:32 AM UTC

Hi Peralta,

We regret about the inconvenience caused.

We were able to reproduce the problem with getting the id/value of the selected item in list box and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates


Please let us know if you have any questions.

Ezhil S

Live Chat Icon For mobile
Up arrow icon