Regression introduced in R2 2020. Possibly related to #5467
<input id="orders" style="width: 100%" />
<script>
$(document).ready(function() {
$("#orders").kendoComboBox({
dataTextField: "ProductName",
dataValueField: "ProductID",
virtual: {
itemHeight: 26,
valueMapper: function(options) {
$.ajax({
url: "Home/Orders_ValueMapper",
type: "GET",
dataType: "json",
data: convertValues(options.value),
success: function (data) {
options.success(data);
}
})
}
},
height: 520,
dataSource: {
transport: {
read: {
url: "Home/Virtualization_Read",
dataType: "json"
}
},
schema: {
model: {
fields: {
ProductID: { type: "number" },
ProductName: { type: "string" },
}
},
data: "Data",
total: "Total"
},
pageSize: 80,
serverPaging: true,
serverFiltering: true
}
});
});
function convertValues(value) {
var data = {};
value = $.isArray(value) ? value : [value];
for (var idx = 0; idx < value.length; idx++) {
data["values[" + idx + "]"] = value[idx];
}
return data;
}
</script>
public ActionResult Virtualization_Read([DataSourceRequest] DataSourceRequest request)
{
return Json(GetProducts().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
public IEnumerable<Product> GetProducts()
{
var products = Enumerable.Range(0, 0).Select(i => new Product
{
ProductID = i,
ProductName = "ProductName" + i
});
return products;
}
A request to the Read action is sent with the following parameters:
http://localhost:54962/Home/Virtualization_Read?take=0&skip=NaN&page=NaN&pageSize=0&filter%5Blogic%5D=and
The NaN value of the parameters: skip=NaN&page=NaN causes a server error:
Input string was not in a correct format.
...
[Exception: NaN is not a valid value for Int32.]
No exception should be thrown. In versions prior to R2 2020 a request is not sent to the server on pressing Down arrow key.