Kendo UI Combobox - 加载大量数据

时间:2016-02-09 10:00:28

标签: jquery knockout.js kendo-ui kendo-combobox

我们已经实施了Kendo Combobox,它将使用自定义模板加载大约2万条记录。但它耗费了大量时间。有没有办法在第一次加载数据时提高性能?

1 个答案:

答案 0 :(得分:0)

正如评论中所建议的那样,您不应该尝试优化大量数据的加载。 相反,您应该使用Kendo ComboboxKendo Autocomplete控件的服务器过滤功能过滤您在服务器端检索的数据。

对我链接的页面进行代码示例,我强调了以下重要部分:

$("#products").kendoComboBox({
            placeholder: "Select product",
            dataTextField: "ProductName",
            dataValueField: "ProductID",
            filter: "contains",
            autoBind: false, //this is important
            minLength: 3,
            dataSource: {
                type: "odata",
                serverFiltering: true, //this is important
                transport: {
                    read: {
                        url: "//demos.telerik.com/kendo-ui/service/Northwind.svc/Products",
                    }
                }
            }
        });
相关问题