Completed
Last Updated: 14 Dec 2023 12:44 by ADMIN
Release 2020.R3.SP1
Stig
Created on: 15 Apr 2020 12:51
Category: FileManager
Type: Bug Report
3
Context method "Destroy" sends multiple delete requests

I'm trying to use the delete context method, but when selecting multiple folders and deleting them it sends the same delete request multiple times. The more folders (no subfolders) I try to delete the more requests it sends.

 

My theory is that the datasource somehow doesn't register it has been deleted, so it tries to automatically sync the datasource by sending it again. Note that I'm using a virutal filesystem, but I'm returning the same object as in this sample

 

Also note that I'm using a mix of MVC and Jquery so I have a custom scheme as recommended in some of my previous tickets.

 

This is scheme:

$.extend(true, kendo.data, { schemas: { "filemanager": { data: function (data) { return data.Items || data || []; }, model: { id: "path", hasChildren: "hasDirectories", fields: { entryId: { field: "EntryId", editable: false, type: "Number" }, folderId: { field: "FolderId", editable: false, type: "Number" }, name: { field: "Name", editable: true, type: "String", defaultValue: "New Folder" }, size: { field: "Size", editable: false, type: "Number" }, path: { field: "Path", editable: false, type: "String" }, extension: { field: "Extension", editable: false, type: "String" }, isDirectory: { field: "IsDirectory", editable: false, defaultValue: true, type: "Boolean" }, hasDirectories: { field: "HasDirectories", editable: false, defaultValue: false, type: "Boolean" }, created: { field: "Created", type: "Date", editable: false }, createdUtc: { field: "CreatedUtc", type: "Date", editable: false }, modified: { field: "Modified", type: "Date", editable: false }, modifiedUtc: { field: "ModifiedUtc", type: "Date", editable: false } } } } } });


        $("#document-manager").kendoFileManager({
            dataSource: {
                transport: {
                    read: {
                        type: "post",
                        url: "/FileManager/Read",
                        data: function() {
                            return getFileMetaData()
                        }
                    },
                    update: {
                        type: "post",
                        url: "/FileManager/Rename",
                    },
                    create: {
                        type: "post",
                        url: "/FileManager/Create",
                        data: function () {
                            return getFileMetaData()
                        }
                    },
                    destroy: {
                        type: "post",
                        url: "/FileManager/DeleteEntry"
                    }
                },
            },
            contextMenu: {
                items: [
                    { name: "rename" },
                    { name: "delete" }
                ]
            },
        });

 

And lastly my C# controller method which deletes the folder and returns the same object as in the above mentioned sample:


        [HttpPost]
        public async Task<ActionResult> DeleteEntry(FileManagerEntry deleteDto)
        {
            await _fileManagerService.DeleteEntry(deleteDto);

            return Json(new object[0], JsonRequestBehavior.AllowGet);
        }

 

You can also see in this screencast that it sends the delete request multiple times for the same entry:

https://screencast-o-matic.com/watch/cYfolKzXZs

 

1 comment
ADMIN
Misho
Posted on: 16 Apr 2020 12:50

Hello,

 

Thank you for bringing this issue to our attention. We could confirm it is reproducible and I've logged it in our public github backlog for further research. You could observe its status on the following link:

https://github.com/telerik/kendo-ui-core/issues/5713

As a small token of gratitude for your report I'm updating your Telerik points.

Best Regards,
Misho
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.