Hello, i have a Kendo drop down on my form which i anticipate will need to handle large volumes of data and so i am trying to configure virtualisation, however i am struggling to understand how to configure correctly. I am new to Kendo so please excuse if this is a silly question.
My drop down will display remote data however, at the point of creating the drop down the data will have been retrieved earlier and stored in a variable. here is my drop down:
$("#newDropDown").kendoDropDownList({
filter: "contains",
dataTextField: "Value",
dataValueField: "ID",
dataSource: items,
select: onDropDownSelect,
noDataTemplate: $("#noDataTemplate").html(),
optionLabel: "Please select ..",
pageSize: 80,
serverPaging: true,
serverFiltering: true,
virtual: {
itemHeight: 26,
valueMapper: function (options) {
options.success([options.value || 0]);
}
},
});
I think where i am going wrong is my value mapper and my misunderstanding of how to configure it for my requirements. i have read the documentation and examples from https://docs.telerik.com/kendo-ui/controls/editors/combobox/virtualization, but remain unclear.
I have configured the no data template on my drop down to allow adding a new item if it does not exist on search. This is presented as a modal pop and on close of the modal window the item is created, drop down refreshed and the selected item set to the newly created data item. The line of code i have dynamically setting the selected item is:
$("#newDropDown").data("kendoDropDownList").value(NEW_ITEM_ID)
this works successfully before i added in virtual configuration. Could someone explain how my value mapper should be configured in such scenario or point me towards documentation that might help explain it better? any examples ive loked at so far the valueMapper makes a remote call- is it required to callfor data again?
Many thanks