2014-04-09 66 views

回答

1

分組不被劍道的DropDownList控件的支持。

2

截至2015年第一季度發佈,數據源支持此功能。看起來當你綁定到本地數據時你可以做到這一點。

1

分組實際上現在支持,在與數據源相結合。這裏是一個代碼片段,它將使用Kendo UI 2015.3.1111和jQuery 1.9.1創建一個下拉列表,按團隊顏色進行分組。數據源candidates是數據項的本地數組。下拉列表將替換頁面上的HTML元素,<input id="victim"/>

var candidates = [ 
    { "id": 1, "name": "Alice", "team": "Red" }, 
    { "id": 2, "name": "Bob", "team": "Red" }, 
    { "id": 3, "name": "Charlie", "team": "Blue" }, 
    { "id": 4, "name": "Dorothy", "team": "Blue" }, 
    { "id": 5, "name": "Ed", "team": "Green" }, 
    { "id": 6, "name": "Frances", "team": "Green" }, 
    { "id": 7, "name": "George", "team": "Purple" }, 
    { "id": 8, "name": "Helen", "team": "Purple" }, 
]; 

$("#victim").kendoDropDownList({ 
    "dataTextField": "name", 
    "dataValueField": "id", 
    "dataSource": { "data": candidates, "group": "team" }, 
    "index": 0 
}); 

這是下拉的樣子與股票造型在FireFox: Team members dropdown list

我以前沒有注意到,但小部件還承攬組。