Cannot manage to scroll to next page when the virtualization is activated in Combobox and text/value fields are pre-set with the values which are not in the datasource

0 Answers 70 Views
ComboBox
Robert
Top achievements
Rank 1
Robert asked on 23 Dec 2022, 03:51 PM

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
                }
            });

Nikolay
Telerik team
commented on 28 Dec 2022, 11:04 AM

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

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Robert
Top achievements
Rank 1
Share this question
or