Hi,
I'm using kendo ui grid with some foreign columns. I mean some dropdownlist to select Key/Value pair data. It works fine in update mode, but not in add mode.
I started with this example:
Here is a litle snippet. AssignmentType is a column filled by an object with properties Id and Description (Edit mode is a dropdownlist). You can see attach files to understand what I mean.
If I remove the column from grid, all works fine, but if the column is shown in the grid, the value for column AssignmentType is set to value "1" and not the object selected in the dropdownlist.
Thank you for your help
$scope.mainGridOptions = {
dataSource: {
transport: {
read: {
url: "/Request/GetRequests",
dataType: "json"
},
update: {
url: "/Request/UpdateRequest",
dataType: "json"
},
destroy: {
url: "/Request/DeleteRequest",
dataType: "json"
},
create: {
url: "/Request/CreateRequest",
dataType: "json"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
batch: true,
pageSize: 20,
schema: {
model: {
id: "RequestId",
fields: {
RequestId: { type: "number" },
AssignmentType: { },
RequestType: { },
CERType: { }
}
}
}
},
pageable: true,
height: 550,
toolbar: ["create"],
columns: [
{ command: ["edit", "destroy"], title: " ", width: "250px" },
{
field: "RequestId",
filterable: false
},
{
field: "AssignmentType",
title: "AssignmentType",
template: "#=AssignmentType == null ? '' : AssignmentType.Description#"
},
{
field: "RequestType",
title: "RequestType",
template: "#=RequestType == null ? '' : RequestType.Description#"
},
{
field: "CERType",
title: "CERType",
template: "#=CERType == null ? '' : CERType.Description#"
}