2017-04-18 70 views
0

我正在使用kendo網格,當我從下拉菜單中更改某個值時,它不會將其保存在行中。只要您點擊它,它就會恢復到相同的值。Kendo Grid內嵌下拉不起作用

$(function() { 
    $("#grid").kendoGrid({ 
     pageable: true, 
     height: 550, 
     resizable: true, 
     toolbar: ["create"], 
     columns: [ 
      { field: "checkBox", filterable: false, title: "<input type=\'checkbox\' class='selectAll' />", width: "35px", template: "<input type=\'checkbox\' class=\'selectAll\' />" }, 
      { field: "index", filterable: true, title: "#", width: "35px" }, 
      { field: "Priority", editor: categoryDropDownEditor, filterable: true, title: "Priority Two", width: "120px" }, 
     ], 
     editable: true, 
     }) 
    }); 

function categoryDropDownEditor(container, options) { 
    $("<input data-bind='field:Priority' />") 
     .appendTo(container) 
     .kendoDropDownList({ 
      dataSource: [ 
       { title: "Yes" }, 
       { title: "No" } 
      ], 
      dataTextField: "title", 
      dataValueField: "title", 
     }); 
} 

我只想使用是/否下拉菜單。當我點擊該字段時,值就在那裏,但是當我選擇「是」或「否」時,沒有任何內容輸入到網格中。不知道爲什麼這不起作用。

回答

1

您可以在kendoDropDownList

入住這jsFiddle設置valuePrimitive。希望這對你有用。