剑道网格内的剑道组合框编辑不起作用
Kendo Combobox inside kendo grid edit not working
我在剑道网格中有一个剑道组合框。我使用MVVM绑定将组合框绑定到列表中的项目。问题是,当我从组合框下拉列表中选择一个项目时,一切都很好,但当我手动在组合框中键入内容时,值不会保存。。。这是我的网格和组合框代码:
栅格:
$("#specificJoinGrid-" + this.gridID).kendoGrid({
dataSource: this.dataSource,
autoBind: true,
toolbar: ["create"],
sortable: {
mode: "multiple",
allowUnsort: true
},
columns: [
{ field: "ToField", title: OlapManagerLabels.Field, width: "20%", editor: fieldDropDownEditor.bind(this), template: "#=ToField#" },
{ field: "SpecificOperator", title: OlapManagerLabels.Operator, width: "15%", editor: operatorDropDownEditor.bind(this), template: "#=OlapManagerNamespace.getOperator(SpecificOperator)#" },
{ field: "SpecificValue", title: OlapManagerLabels.Value, width: "30%", editor: valueDropDownEditor.bind(this), template: "#=SpecificValue#" },
{ field: "SecondSpecificValue", title: OlapManagerLabels.SecondValue, width: "30%", editor: secondValDropDownEditor.bind(this), template: "#=SecondSpecificValue#" },
{ command: { name: "x", width: "5%" } }
],
editable: { createAt: "bottom" },
edit: function(e) {
var model = e.model; // access edited/newly added model
// model is observable object, use set method to trigger change event
model.ID = BINamespace.guid32();
model.set("id", model.ID);
},
selectable: true
});
数据来源:
this.dataSource = new kendo.data.DataSource({
data: DataSource,
batch: true,
schema: {
model: {
id: "ID",
fields: {
ToField: { editable: true, required: true },
SpecificOperator: { editable: true, required: true, defaultValue: 6 },
SpecificValue: { editable: true },
SecondSpecificValue: { editable: true },
DataSourceID: { defaultValue: this.dataSourceID },
ID: {},
Type: { defaultValue: 1 },
ToTableID: { defaultValue: this.tableID }
}
}
}
});
组合框:
valueDropDownEditor = function (container, options) {
var grid = $("#specificJoinGrid-" + this.gridID).data("kendoGrid");
var row = grid.select();
if (options.model.SpecificOperator != 1 && options.model.SpecificOperator != 0) {
$('<input data-text-field="Key" data-value-field="Key" data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoComboBox({
autoBind: false,
dataSource: this.globalsDropDownDS,
template: "#=Description# (#=Key#)",
change: value1Changed.bind(this)
});
}
else {
grid.closeCell(container);
}
}
因此,如果其他人遇到这个问题,我找到了解决方案。一旦我从编辑器中删除了autobind: false
属性,组合框就会完全按照要求工作。。不知道为什么我花了这么长时间才弄清楚,但希望这能帮助到一些人!
相关文章:
- 编辑不起作用的表单的特定行和重置特定字段
- `ie9`-contenteditable false在父级可编辑时不起作用
- 在内联编辑的情况下,Knockout绑定不起作用
- jqGrid-保存内联编辑不起作用
- Node.js应用程序中的编辑不起作用
- 所见即所得内容中的撤消和重做SWT中的可编辑内容;不起作用
- CKEditor编辑器.resize()在jQuery中不起作用
- 编辑器导出的json文件不起作用
- 在我的项目中,添加、删除和编辑功能不起作用
- 禁用编辑和删除按钮在IE9中不起作用,但在IE11中起作用
- 单击动态创建的编辑按钮不起作用
- Emberjs 车把内容绑定编辑字段不起作用
- AngularJS编辑记录行为不起作用
- 箭头键在内容中不起作用可编辑
- 如何在选择框中设置只读 false,当选中复选框时,它将是可编辑的.在我的jquery代码中,禁用不起作用
- 数据表可编辑插件在数据表中动态添加行后不起作用
- 添加,编辑,删除不起作用
- AngularJS使用模板进行内联编辑不起作用
- 剑道网格内的剑道组合框编辑不起作用
- 本地存储编辑不起作用