jeudi 7 juillet 2016

Kedo UI combobox freezes when doing server filtering


I am getting around 6000 records that I need to bind to combobox. I am doing server filtering on it when user types at least 2 characters. It works fine for the first time but when I clear the combobox my page freezes. Please suggest what I might be doing wrong . Below is how I initiated my combobox.

$("#myList").kendoComboBox({
        filter: "startswith",
        dataTextField: "xName",
        dataValueField: "xId",
        template: '<span>#:xName# (#:gName#-#:gmName#)</span>',
        dataSource: viewModel.get("mydataList"),
        height: 400,
        autoBind: false,
        minLength: 2,
    }).data("kendoComboBox");

Below is how I have specified the datasource:

mydataList= new kendo.data.DataSource({
        transport: {
            read: {
                dataType: "json",
            },
            parameterMap: function (options, operation) {
                if (operation !== "read" && options.models) {
                    return {
                        models: kendo.stringify(options.models)
                    };
                }
            }
        },
        serverFiltering: true
    }
    );

Also please suggest if I can hide the dropdown arrow.


Aucun commentaire:

Enregistrer un commentaire