Hello!
I could not manage to implement a combobox widget with virtualization if the text/value fields are set with values which are not in the datasoruce:
Here is an example code:
$("#orders").kendoComboBox({
template: '#= OrderID # | #= ShipName #',
dataTextField: "ShipName",
dataValueField: "OrderID",
text: 'Not in the list',
value: 0,
virtual: {
itemHeight: 26,
valueMapper: function(options) {
$.ajax({
url: "https://demos.telerik.com/kendo-ui/service/Orders/ValueMapper",
type: "GET",
dataType: "jsonp",
data: convertValues(options.value),
success: function (data) {
options.success(data);
}
})
}
},
height: 520,
dataSource: {
type: "odata",
transport: {
read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
},
pageSize: 80,
serverPaging: true,
serverFiltering: true
}
});
Hi Martin,
Is there a specific reason you are setting a value that is not present in the data source? In general, if you do not know the value you want to initially bind the ComboBox to it's better not to set value property at all.
Regards,
Nikolay