Kendo DropDownList - 如何手动选择项目?

时间:2015-10-15 15:18:15

标签: kendo-ui

我将dropDownList用于我的某个网格列。我尝试在加载数据后手动选择一个项目:

columns: [
{
      field: "SomeName", title: "Name",
      editor: function (container, options) {
            $scope.options = {
                    dataSource: someSource,
                    dataTextField: "Name",
                    dataValueField: "ID",
                    dataBound: function (e) {
                        e.sender.select(2);
                    }
            }
            var editor = $('<input kendo-drop-down-list k-options="options" required  data-bind="value:' + options.field + '"/>')
                         .appendTo(container);
      }
}]

但没有任何事情发生,服务器返回的数据是:

[{"ID":2,"Name":"abc"}]

1 个答案:

答案 0 :(得分:0)

最后,我想出来了:

e.sender.value(2);