Grid - The "Update" button in a row does nothing in inline edit mode

1 Answer 231 Views
Grid
Gerke van den Akker
Top achievements
Rank 1
Gerke van den Akker asked on 20 Dec 2023, 11:28 AM | edited on 21 Dec 2023, 09:00 AM

I am setting up a grid with inline edit mode and CRUD operations. I add the "create" option in the toolbar and added a command column with "edit" and "delete" options. When I use the add row button, or the edit row button, then the command column changes to contain "Update" and "Cancel" buttons. When I click the "Update" button, nothing seems to happen. The change does not get saved, I see no errors in the console and mu console.logs in the update/create/delete functions also don't get triggered. I am using version 2022.2.621 of Kendo UI for jQuery. (I cannot easily update to a newer version, because we have custom CSS for most components and with every new update, we have a ton of work to update this CSS, because Kendo is always changing/removing/adding class names on HTML elements for some reason.)

I have created an example in the dojo where you can reproduce this problem: https://dojo.telerik.com/eRibIRed

Did I configure the grid wrongly?

Update: I tried version 2023.3.1114 and have the same problem there.

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 25 Dec 2023, 05:15 AM

Hi Gerke van den Akke,

Thank you for sharing the Dojo demo.

I looked into it and noticed the schema declaration is placed wrongly on the Grid level and it must be nested inside the data source:

        dataSource: {
          transport: {
            read: (options) => {
              options.success(data);
            },
            create: (options) => {
              console.log("create", options);
              options.success(options.data);
            },
            update: (options) => {
              console.log("update", options);
              options.success(options.data);
            },
            delete: (options) => {
              console.log("delete", options);
              options.success(options.data);
            },
            parameterMap: (data, operation) => {
              console.log("parameterMap", data, operation);
              if (operation !== "read") {
                return kendo.stringify($.extend({ "subject": "endpoints" }, data));
              }
            }
          },
          schema: {
            model: {
              id: "id",
              fields: {
                id: { type: "number" },
                objectId: { type: "number" },
                objectName: { type: "string" },
                roleId: { type: "number" },
                roleName: { type: "string" },
                endpointUrl: { type: "string" },
                endpointHttpMethod: { type: "string" },
                permission: { type: "number" }
              }
            }
          }
        }

Updated Dojo: https://dojo.telerik.com/eRibIRed/4

Please let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Gerke van den Akker
Top achievements
Rank 1
commented on 27 Dec 2023, 10:05 AM | edited

Dear Nikolay,

Thank you for the answer. I have been very blind as I did not notice this.

Nikolay
Telerik team
commented on 27 Dec 2023, 01:07 PM

Hi Gerke van den Akker,

You are welcome and not problem. That's what we are here for.

Regards,

Nikolay

Tags
Grid
Asked by
Gerke van den Akker
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or