Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
Kendo dropdown giving [Object Object] when binding values dynamically from array

This is my code:

var arr = [];

 for (var i = 0; i < GanttData.length; i++) 
     {  arr.push({"text":GanttData[i].Projectname,"value":GanttData[i].Projectuid});}   

var dropdownlistF = $("#drp_resources").data("kendoMultiSelect");
dropdownlistF.setDataSource(arr);

But it's not working. Any help will be blessing.

Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It depends on how you defined the widget parameters. According to MultiSelect docs the default text field name it will look for in the data is ''(dataTextField), so you need to set it:

$("#drp_resources").kendoMultiSelect({
    dataTextField: 'text'
});

Demo:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Untitled</title>

  <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2022.2.510/styles/kendo.common.min.css">
  <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2022.2.510/styles/kendo.rtl.min.css">
  <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2022.2.510/styles/kendo.default.min.css">
  <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2022.2.510/styles/kendo.mobile.all.min.css">

  <script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
  <script src="https://kendo.cdn.telerik.com/2022.2.510/js/angular.min.js"></script>
  <script src="https://kendo.cdn.telerik.com/2022.2.510/js/jszip.min.js"></script>
  <script src="https://kendo.cdn.telerik.com/2022.2.510/js/kendo.all.min.js"></script></head>
<body>
  <select id="drp_resources"></select>
  <script>
  var arr = [],
      GanttData = [{
        Projectname: 'test', 
        Projectuid: 123
      }];
    
    $("#drp_resources").kendoMultiSelect({
      dataTextField: 'text'
    });

   for (var i = 0; i < GanttData.length; i++) 
       {  arr.push({"text":GanttData[i].Projectname,"value":GanttData[i].Projectuid});}   

  var dropdownlistF = $("#drp_resources").data("kendoMultiSelect");
  dropdownlistF.setDataSource(arr);
  </script>
</body>
</html>

Dojo

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!