In the scheduler demo, how are the resources mapped from "Text, Value, Color" to "ownerId"?
Here is what I am trying to do, I have to transform my data and I don't understand how to maps this example data source to"ownerId"?
resources: [
{
field:
"ownerId"
,
title:
"Owner"
,
dataSource: [
{ text:
"Alex"
, value: 1, color:
"#f8a398"
},
{ text:
"Bob"
, value: 2, color:
"#51a0ed"
},
{ text:
"Charlie"
, value: 3, color:
"#56ca85"
}
]
}
]
resources: [
{
field:
"ownerId"
,
title:
"Owner"
,
dataSource:
{
type:
"json"
,
transport:
{
read: {
url:
"/api/_Users?filter=(IsUser%20eq%201)"
,
type:
"GET"
}
},
schema:
{
parse:
function
(response)
{
var
users = [];
var
inner = response.results;
for
(
var
i = 0; i < inner.length; i++)
{
var
user = {
text: inner[i].Attributes.FirstName,
value: inner[i].Attributes.Id,
color:
"#ff0000"
}
}
users.push(user);
return
users;
}
}
}
}
]