All Components

Virtualization

Virtualization allows you to display large sets of data.

Regardless of the dataset size, the UI virtualization technique uses a fixed amount of list items in the popup list of the component. When the list is scrolled, the MultiSelect reuses the existing items to display the relevant data instead of creating new data.

The following example demonstrates how to set the minimum configuration of the MultiSelect and the DataSource to enable the virtualization.

<div id="vueapp" class="vue-app">
    <kendo-datasource ref="datasource"
                      :type="'odata'"
                      :transport-read-url="'https://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders'"
                      :schema-model-fileds="fields"
                      :server-filtering="true"
                      :server-paging="true"
                      :page-size="40">
    </kendo-datasource>
    <kendo-multiselect ref="multiselect"
                       :data-source-ref="'datasource'"
                       :data-text-field="'ShipName'"
                       :data-value-field="'OrderID'"
                       :placeholder="'Select orders...'"
                       :virtual-value-mapper="valueMapperFunction"
                       :virtual-item-height="26"
                       :height="260"
                       :item-template="itemTemplate">
    </kendo-multiselect>
</div>
Vue.use(DropdownsInstaller);
Vue.use(DataSourceInstaller);

new Vue({
    el: "#vueapp",
    methods: {
        convertValues (value) {
            var data = {}
            value = $.isArray(value) ? value : [value]

            for (var idx = 0; idx < value.length; idx++) {
                data['values[' + idx + ']'] = value[idx]
            }

            return data
        },
        valueMapperFunction: function (options) {
            var that = this;

            $.ajax({
                url: 'https://demos.telerik.com/kendo-ui/service/Orders/ValueMapper',
                type: 'GET',
                dataType: 'jsonp',
                data: that.convertValues(options.value),
                success: function (data) {
                    options.success(data)
                }
            })
        },
    },
    data: {
        fields: {
            OrderID: { type: 'number' },
            Freight: { type: 'number' },
            ShipName: { type: 'string' },
            OrderDate: { type: 'date' },
            ShipCity: { type: 'string' }
        },
        itemTemplate: '<strong>#= OrderID #</strong> - #= ShipName #, #= ShipCountry #'
    },
    mounted() {
        var multiselect = this.$refs.multiselect.kendoWidget()
        multiselect.value(10600)
    }
})
In this article