I have a hierarchical kendo ui grid that is successfully displaying items from my database, but for some reason the "Add New Record" button in the detail grid doesn't add a new row or fire any event, nor does it pull any error, and I am at a loss as to how to go about debugging this.
Each Log entity can have many LogAppends, and the children of a Log are rendering properly in the detail grid.
Here is my grid html:
<
div
kendo-grid
k-options
=
"registrationOptions"
k-data-source
=
"logginggridData"
k-columns
=
"gridColumns"
k-selectable
=
"true"
>
<
div
k-detail-template>
<
kendo-tabstrip
>
<
ul
>
<
li
class
=
"k-state-active"
>Append Logs</
li
>
</
ul
>
<
div
>
<
div
kendo-grid
k-options
=
"detailGridOptions(dataItem)"
></
div
>
</
div
>
</
kendo-tabstrip
>
</
div
>
</
div
>
$scope.detailGridOptions = function(dataItem) {
return {
dataSource: {
transport: {
read: {
url: "api/logappends/",
dataType: "json",
contentType: "application/json"
},
update: {
url: "api/logappends/",
type: "post",
dataType: "json",
contentType: "application/json"
},
create: {
contentType: "application/json",
url: "api/logappends/",
type: "post",
dataType: "json",
data: function(data) {
console.log("CREATING TEST DATA");
console.log(data.models[0]);
return data.models[0];
}
},
parameterMap: function(options, operation) {
if (operation == "update") {
return JSON.stringify(options.models[0]);
}
if (operation == "create") {
return JSON.stringify(options.models[0])
}
if (operation == "destroy") {
return JSON.stringify(options.models[0]);
}
}
},
error: function(e) {
// handle error
console.log(e);
},
schema: {
data: function(data) { //specify the array that contains the data
console.log("DATA RETURN TEST");
console.log(data);
return data || [];
},
model: {
id: "LogAppendId",
fields: {
LogAppendId: {
editable: true,
nullable: false,
type: "number"
},
DateAppended: {
type: "date"
},
Type: {
type: "string"
},
Comments: {
type: "string"
}
}
}
},
pageSize: 5,
filter: {
field: "LogId",
operator: "equal",
value: dataItem.LogId
}
},
scrollable: false,
sortable: true,
pageable: true,
toolbar: ["create"],
editable: "inline",
autoBind: true,
batch: true,
height: 550,
filterable: true,
columns: [{
field: "LogAppendId",
title: "ID",
width: "56px"
}, {
field: "Comments",
title: "Comments",
width: "240px"
}, {
field: "Type",
title: "Type",
width: "110px"
}, {
field: "DateAppended",
title: "Date Appended"
}, {
command: ["edit", "destroy"],
title: " ",
width: "250px"
}]
};
};
Any help would be appreciated. Thank you.