我在kendo网格中绑定了kendo combo。组合应基于相邻列的项代码动态绑定。我写了下面的代码。组合不会绑定。
$("#DieItemGrid").kendoGrid({
dataSource: {
data: result,
autoSync: true,
schema: {
model: {
id: 'ParentItemId',
fields: {
ParentItemCd: { type: "string", nullable: false },
ChildItemCd: { editable: false }
}
}
}
},
columns:
[
{
field: "ChildItemCd",
title: "Die Item Code",
headerAttributes: {
style: "vertical-align: middle;"
}
},
{
field: "InternalRevDatalist", title: parentItemCd + "<br>Int. Rev Step",
editor:
function (container, options) {
$.FwAJAX({
showBusyIndicator: false,
url: $.FwRoute.Base() + "GetInternalRevStepList",
data: { itemCd: "#=ChildItemCd#" },//not able to get this id
//data: {itemCd: '10036064'},
dataType: 'json',
success: function (result) {
$('<input required name="' + options.field + '"/>')
.appendTo(container)
.kendoComboBox({
autoBind: false,
dataTextField: "Description",
dataValueField: "FriendlyId",
placeholder: "-- Select --",
dataSource: result,
change: function (e) {
e.preventDefault();
//onchange
}
});
}
});
}
, template: dieinternalRevListTemplate
}
],
dataBound: function () {
var dataView = this.dataSource.view();
for (var i = 0; i < dataView.length; i++) {
var uid = dataView[i].uid;
$("#DieItemGrid tbody").find("tr[data-uid=" + uid + "]").addClass("datadisable");
}
},
editable: true,
selectable: "multiple cell",
});
我无法获得ChildItemCd。根据这个ID,我需要填充组合框。
答案 0 :(得分:1)