I have the following grid defined in my HTML;
and in my adminController.js file I have;
The data is displayed correctly when the grid is loaded as can be seen in the attached Grid1.png image.
The custom editor for the report type displays the correct options and when the report is changed to "Sustain" the Report ID is updated correctly as can be seen in Grid2.png and Grid3.png respectively.
However when I select Update nothing happens. I have tried placing breakpoints within the "success:" and "error:" functions in both the "update" and "create" transport sections and also in the server-side code but none of the breakpoints are ever reached.
I also tried using;
but this didn't work either.
Any assistance in regards to this would be appreciated.
<kendo-grid id="reportGrid" k-sortable="true" k-pageable="true" k-filterable="true" k-resizeable="true" k-selectable="'row'" k-options="reportGridOptions"></kendo-grid>and in my adminController.js file I have;
$scope.reportGridOptions = { dataSource: { transport: { read: function (options) { $.ajax({ url: "/Home/GetReports", dataType: "json", success: function (result) { options.success(result); } }); }, update: function (options) { $.ajax({ url: "/Home/UpdateReport", dataType: "json", type: "post", data: options.data, success: function (result) { options.success(result); }, error: function (result) { options.error(result) alert("An error occurred updating the report"); } }); }, create: function (options) { $.ajax({ url: "/Home/UpdateReport", dataType: "json", type: "post", data: options.data, success: function (result) { options.success(result); }, error: function (result) { options.error(result) alert("An error occurred creating the report"); } }); }, batch: false, pageSize: 10, schema: { model: { id: "id", fields: { id: { type: "number", editable: false, nullable: true, defaultValue: 0 }, name: { type: "string", validation: { required: true } }, reportTypeId: { type: "number", validation: { required: true } }, reportType: { type: "string" }, reportDt: { type: "date", validation: { required: true } }, releasedDt: { type: "date" }, updatedBy: { type: "string", editable: false, nullable: true }, updatedDtTm: { type: "date", editable: false, nullable: true }, rowVersion: { type: "string", editable: false, nullable: true }, } } }, sort: [{ field: "reportDt", dir: "asc" }] }, error: function (e) { // The error message returned will contain the name of the procedure followed by a colon followed by the error message; // <procedure name>:<errorr1></br><error2>...</br><errorn> var err = e.errorThrown.split(":"); console.log(err[0]); console.log(err[1]); // Set the error title and message then display the modal error dialogue... $scope.formData.errorTitle = err[0]; $scope.formData.errorMsg = err[1]; // If the changes aren't "applied" the dialogue won't contain the title and the message... $scope.$apply(); // Display the error... $('#errorDialogue').modal('show'); } }, //height: "500px", toolbar: ["create"], editable: { mode: "inline", update: true, destroy: false }, columns: [ { field: "reportTypeId", title: "Rpt Type ID", width: "100px" }, { field: "reportType", title: "Report Type", width: "100px", editor: '<input name="\'reportTypeId\'" kendo-drop-down-list required k-data-text-field="\'name\'" k-data-value-field="\'id\'" k-data-source="lstRptTypes" data-bind="value:' + "reportTypeId" + '"/>' }, { field: "name", title: "Report Name", width: "200px" }, { field: "reportDt", title: "Report Date", format: "{0:d MMM yyyy}", width: "125px" }, { field: "releasedDt", title: "Released", format: "{0:d MMM yyyy}", width: "125px" }, { command: ["edit"], title: " ", width: "220px" } ]};The data is displayed correctly when the grid is loaded as can be seen in the attached Grid1.png image.
The custom editor for the report type displays the correct options and when the report is changed to "Sustain" the Report ID is updated correctly as can be seen in Grid2.png and Grid3.png respectively.
However when I select Update nothing happens. I have tried placing breakpoints within the "success:" and "error:" functions in both the "update" and "create" transport sections and also in the server-side code but none of the breakpoints are ever reached.
I also tried using;
dataSource: { transport: { read: { url: "/Home/GetReports", dataType: "json", type: "post" }, update: { url: "/Home/UpdateReport", dataType: "json", type: "post" }, create: { url: "/Home/UpdateReport", dataType: "json", type: "post" }, batch: false, pageSize: 10, schema: { model: { id: "id", fields: { // Field data types are String (default), Number, Boolean or Date... id: { type: "number", editable: false, nullable: true, defaultValue: 0 }, name: { type: "string", validation: { required: true } }, reportTypeId: { type: "number", validation: { required: true } }, reportType: { type: "string" }, //, validation: { required: true }, defaultValue: { reportTypeId: 1, reportName: "Phase 1" } reportDt: { type: "date", validation: { required: true } }, releasedDt: { type: "date" }, updatedBy: { type: "string", editable: false, nullable: true }, updatedDtTm: { type: "date", editable: false, nullable: true }, rowVersion: { type: "string", editable: false, nullable: true }, } } }, sort: [{ field: "reportDt", dir: "asc" }] }, error: function (e) { // The error message returned will contain the name of the procedure followed by a colon followed by the error message; // <procedure name>:<errorr1></br><error2>...</br><errorn> var err = e.errorThrown.split(":"); console.log(err[0]); console.log(err[1]); // Set the error title and message then display the modal error dialogue... $scope.formData.errorTitle = err[0]; $scope.formData.errorMsg = err[1]; // If the changes aren't "applied" the dialogue won't contain the title and the message... $scope.$apply(); // Display the error... $('#errorDialogue').modal('show'); }},but this didn't work either.
Any assistance in regards to this would be appreciated.