2016-02-09 44 views
1

我們已經實施Kendo Combobox,它會載入約20,000個記錄,帶有自定義模板。但是它花費了大量的時間。第一次加載數據時有什麼方法可以提高性能嗎?Kendo UI Combobox - 正在載入龐大的數據加載大數據

+0

嘗試[虛擬化](https://demos.telerik.com/kendo-ui/dropdownlist/virtualization) – Ademar

+3

你想添加2萬個項目到一個組合框?也許你應該更多地考慮你的設計,而不是試圖加速它。我不想通過20,000個選項來查找我想要的選項。如果您添加了即搜即得功能,它將大大減少選項,並且使用起來更加簡單。 –

回答

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