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 () {
      $('#selectExperts').ejListBox({
         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
   }
</script>


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

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let us know if you have any questions.

Best,
Ezhil S

Loader.
Up arrow icon