I have a multi select control which allows users to select items, I save the selected items to a database. When the page is next loaded I want to retrieve the list of items from a remote data source but also set the currently selected items.
My code is:
$('#componentList').kendoMultiSelect(
{
autoBind: false,
dataTextField: 'COMPONENT_NAME',
dataValueField: 'COMPONENT_ID',
dataSource: {
transport: {
read: {
url: '/Data/GetData'
dataType: 'json'
}
},
schema: {
data: function (data) { //specify the array that contains the data
return data.fullList;
}
}
});
As you can see my web service returns the data in the field fullList, I also have another field called selectedList on my datasource. How do I set the values from that? Do I have to do a seperate ajax call to get the selected data or can this be done in a single server round trip?
Thanks.
My code is:
$('#componentList').kendoMultiSelect(
{
autoBind: false,
dataTextField: 'COMPONENT_NAME',
dataValueField: 'COMPONENT_ID',
dataSource: {
transport: {
read: {
url: '/Data/GetData'
dataType: 'json'
}
},
schema: {
data: function (data) { //specify the array that contains the data
return data.fullList;
}
}
});
As you can see my web service returns the data in the field fullList, I also have another field called selectedList on my datasource. How do I set the values from that? Do I have to do a seperate ajax call to get the selected data or can this be done in a single server round trip?
Thanks.