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
close icon

How to assign data to resourceSettings: dataSource:

I have a test project at http://jsplayground.syncfusion.com/1bbis2ae

I want to set
resourceSettings: { 
datasource: resourceData,
text: "text",
id: "id",
groupId: "groupId",
color: "color"
}
where resourceData is as follows:

          var resourceData = [
{ text: "Nancy", id: 1, groupId: 1, color: "#f8a398" },
{ text: "Steven", id: 3, groupId: 2, color: "#56ca85" },
{ text: "Mary", id: 13, groupId: 2, color: "blue" },
{ text: "Joe", id: 15, groupId: 2, color: "red" },
{ text: "Michael", id: 5, groupId: 1, color: "#51a0ed" }
            ];


The above code will not work. However, if I use the this code the data is displayed:
resourceSettings: { 
                        dataSource: [
{ text: "Nancy", id: 1, groupId: 1, color: "#f8a398" },
{ text: "Steven", id: 3, groupId: 2, color: "#56ca85" },
{ text: "Mary", id: 13, groupId: 2, color: "blue" },
{ text: "Joe", id: 15, groupId: 2, color: "red" },
{ text: "Michael", id: 5, groupId: 1, color: "#51a0ed" }
],
                        text: "text",
id: "id",
groupId: "groupId",
color: "color"
}

Am I missing something? 





3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team June 9, 2016 06:31 AM UTC

Hi Morgan,   
   
Thank you for contacting Syncfusion support.   
   
In the provided sample,” dataSource” is declared as “datasource” (S in small case) with-in the “resourceSettings” collection which is the cause for the issue. We have modified the provided sample which can be viewed from the below link:    
   
Please let us know if you need any further assistance.   
   
Regards,   
Karthigeyan   
 



MO Morgan June 9, 2016 08:30 AM UTC

Well spotted.

I could have been looking at that for years and not noticed the difference between 'datasource' and 'dataSource'.

Typing errors like that could be common in the future, but checking the spelling will be my first thing I will do if I am having a problem with code.

Thanks for your help


Morgan


KK Karthigeyan Krishnamurthi Syncfusion Team June 10, 2016 05:10 AM UTC

Hi Morgan, 
 
We are happy to hear that your issue has been resolved. 
 
Please let us know if you need any further assistance. 
 
Regards 
Karthigeyan 


Loader.
Live Chat Icon For mobile
Up arrow icon