我有这个jqxGrid设置:
var paymentSource = {
datatype: "json",
datafields: [
{ name: 'Id', type: 'number' },
{ name: 'Name', type: 'string' }
],
url: "@Url.Action("GetPaymentSchemes")"
};
var paymentAdapter = new $.jqx.dataAdapter(paymentSource, { autoBind: true });
var gridSource =
{
datatype: "json",
datafields: [
{ name: 'Name', type: 'string' },
{ name: 'PaymentSchemeId', type: 'number' },
{ name: 'IsActive', type: 'boolean' },
{ name: 'Remarks', type: 'string' }
],
url: "@Url.Action("GetParkades")"
};
var gridDataAdapter = new $.jqx.dataAdapter(gridSource);
$("#index-grid").jqxGrid(
{
theme: theme,
width: 900,
source: gridDataAdapter,
editable: true,
columns: [
{ text: "Name", datafield: "Name", width: 300 },
{
text: 'Payment Scheme',
datafield: 'PaymentSchemeId',
displayfield: 'Name',
columntype: 'dropdownlist',
createeditor: function(row, value, editor) {
editor.jqxDropDownList({ source: paymentAdapter, displayMember: 'Name', valueMember: 'Id' });
}
},
{ text: "Active", datafield: "IsActive", width: 50, columntype: 'checkbox' },
{ text: "Operator Remarks", datafield: "Remarks" }
]
});
“付款方案”列显示与页面加载时“名称”列相同的文本值。当我双击“付款方案”时,我会得到正确填充的下拉列表,但是当我选择一个值并让单元格结束编辑时,“名称”列现在显示与“付款方案”列相同的文本。不同来源和适配器中的两个Name
字段是否冲突?这是什么?