I try it. I dosen't work.
dataManager.ready.done(function (e) {
$("#Grid").ejGrid({
dataSource: ej.DataManager({
json: e.result,
adaptor: new ej.remoteSaveAdaptor(),
insertUrl: "/api/Product/Insert",
updateUrl: "/api/Product/Update",
removeUrl: "/api/Product/Remove",
}),
toolbarSettings: {
showToolbar: true,
toolbarItems: ["add", "edit", "printGrid", "search"]
},
editSettings: {
allowEditing: true,
allowAdding: true,
allowDeleting: false,
showDeleteConfirmDialog: true,
editMode: "dialogtemplate",
dialogEditorTemplateID: "#templateForm",
},
isResponsive: true,
enableResponsiveRow: true,
allowSorting: true,
allowSearching: true,
allowFiltering: true,
filterSettings: {
filterType: "excel",
maxFilterChoices: 100,
enableCaseSensitivity: false
},
allowPaging: true,
pageSettings: { pageSize: 100, printMode: ej.Grid.PrintMode.CurrentPage },
columns: [
{ field: "ProductId", type: 'number', headerText: 'OD-No.', defaultValue: 0, isPrimaryKey: true, isIdentity: true, visible: false },
{ field: "Barcode", type: 'string', headerText: 'P/N', validationRules: { required: true } },
{ field: "ISO", type: 'string', headerText: 'ISO', validationRules: { required: true } },
{ field: "TypeList", headerText: 'Type1', foreignKeyField: "TypeId", foreignKeyValue: "Name", dataSource: dataManagerType, validationRules: { required: true } },
{ field: "SupplierPN", type: 'string', headerText: 'SupplierPN', visible: false },
{ headerText: "Type2", template: "<span>{{:TypeList}}</span > " },
],
actionComplete: "complete",
load: "gridLoad",
});
});
});
function gridLoad(args) {
this.model.dataSource.adaptor = new ej.ForeignKeyAdaptor([{ field: "TypeList", foreignKeyField: "TypeId", foreignKeyValue: "Name", dataSource: dataManagerType }], "remoteSaveAdaptor");
}