【发布时间】:2015-05-10 07:48:17
【问题描述】:
我想将剑道下拉列表包含在我的网格中。 一切都会好起来的,除了一件事。 当我想使用默认剑道创建工具栏“添加记录”时,我无法绑定从下拉列表数据源中获取的第一个值。
数据源工作正常。下拉列表也可以正常工作。 如果我手动从下拉列表中选择任何内容,一切正常。
$scope.mainGridOptions = {
dataSource: {
transport: ...
schema: ...
},
batch: false,
...
toolbar: ["create"],
columns: [
...,{
field: "location_id",
title: "Location",
editor: function(container,options){
var input = $('<input/>');
input.attr('name',options.field);
input.appendTo(container);
input.kendoDropDownList({
autoBind: true,
dataTextField: "text",
dataValueField: "value",
dataSource: locationsDataSource,
index: 0,
});
}
},
...
]
};
我也试过这个。除了“索引”,我尝试从数据源中手动选择第一项。视觉上它工作正常。即使选择了第三项,但是当我单击“更新”时,数据没有限制。
input.kendoDropDownList({
autoBind: true,
dataTextField: "text",
dataValueField: "value",
dataSource: locationsDataSource,
dataBound: function(e){
this.select(0);
}
});
有人吗?
【问题讨论】:
标签: kendo-ui kendo-grid kendo-dropdown