Hi
I'm trying to get a dropdown box in a custom popup template to populate from a datastore but can't get it to work. If I use the default popup custom binding an editor to the data store it works, but I need to use a custom template.
Here is my code
//datastore setup
var ds_YesNo = new kendo.data.DataSource({
transport: {
read: {
url: URL_TO_DS,
type: "get",
dataType: "json"
}
},
schema: {
data: "children",
total: function(response) {
return response.paging.YesNo.count;
}
}
})
ds_YesNo.read();
The datastore returns the following back
{
"paging": {
"YesNo": {
"page": 1,
"current": 2,
"count": 2,
"prevPage": false,
"nextPage": false,
"pageCount": 1,
"order": null,
"limit": 10,
"options": {
"conditions": []
},
"paramType": "querystring"
}
},
"children": [
{
"YesNo_YesNoID": "N",
"YesNo_YesNoName": "No"
},
{
"YesNo_YesNoID": "Y",
"YesNo_YesNoName": "Yes"
}
]
}
Then in my edit template I have this
<div class="k-edit-field" data-container-for="Staff_Active">
<input name="Staff_Active"
data-bind="value:Staff_Active"
data-value-field="YesNo_YesNoID"
data-text-field="YesNo_YesNoName"
data-source="ds_YesNo"
data-role="dropdownlist" />
</div>
but the dropbox is empty - all the other standard input text fields display fine.
Would appreciate some assistance.
Regards
Dave