This is a migrated thread and some comments may be shown as answers.

FileManager New Folder - Uncaught ReferenceError

3 Answers 76 Views
FileManager
This is a migrated thread and some comments may be shown as answers.
Doran
Top achievements
Rank 1
Doran asked on 02 Jul 2020, 07:14 PM

Using FileManager in our app, and we are seeing the following exception when trying to create a "New Folder".   We do not see this error with any other operations, and are able to upload, rename, & delete files/folders without issue.   Is this a binding issue with our resulting json (see below)?  The funny thing is that this exception does not occur every time we click the "New Folder" button.  It shows up maybe 75% of the time. 

 

The exception is:

VM8695:3 Uncaught ReferenceError: extension is not defined
    at eval (eval at compile (kendo.all.js:234), <anonymous>:3:164)
    at init.refresh (kendo.all.js:70463)
    at init.proxy (jquery-3.1.1.js:502)
    at init.trigger (kendo.all.js:164)
    at init._process (kendo.all.js:7940)
    at init._change (kendo.all.js:7889)
    at init.proxy (jquery-3.1.1.js:502)
    at init.trigger (kendo.all.js:164)
    at init.splice (kendo.all.js:5008)
    at init.insert (kendo.all.js:7078)

 

 

Our FileManager datasource is a configured like this...

dataSource: {
    schema: kendo.data.schemas.filemanager,
    transport: {
        read: {
            url: "MyController/GetObjects/",
            method: "POST"
        },
        create: {
            url: "MyController/CreateObject/",
            method: "POST"
        },
        update: {
            url: "MyController/UpdateObject/",
            method: "POST"
        },
        destroy: {
            url: "MyController/DestroyObject/",
            method: "POST"
        },
    },
},

 

 

Our controllers method for CreateObject is:

[HttpPost]
public ActionResult CreateObject(string target)
{
    var result = myService.CreateFolder("NewFolder", target);
    return Json(result, JsonRequestBehavior.AllowGet);
}

 

 

And the json results are:

{
    "SId": "<guid>",
    "ObjectType": "Folder",
    "IsDirectory": true,
    "HasDirectories": false,
    "RootPath": "<some stuff>",
    "NameSpace": "<some stuff>",
    "Path": "myDir\\NewFolder",
    "Name": "NewFolder",
    "Extension": "",
    "Size": 0,
    "PathLocator": "<some stuff>",
    "ParentPathLocator": "<some stuff>",
    "Created": "\/Date(1593736985477)\/",
    "CreatedUtc": "\/Date(-62135571600000)\/",
    "Modified": "\/Date(1593736985477)\/",
    "ModifiedUtc": "\/Date(-62135571600000)\/",
    "Content": null
}

 

 

Thanks for any advice.

 

Doran

3 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 06 Jul 2020, 12:02 PM

Hello Doran,

Looking at the posted dataSource configuration it appears you are using the Kendo UI for jQuery FileManager, not the UI for ASP.NET MVC one. If that is so, they use different schemas - the former uses camel case (e.g. "name": "NewFolder", "isDirectory": "true"), the latter uses pascal case (e.g. "Name": "NewFolder", "IsDirectory": "true"). So this is something you could try changing in your service.

Another thing I notice is the way the path is returned: "Path": "myDir\\NewFolder",

Try with: "path":"myDir/NewFolder"

Regards,
Ivan Danchev
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.
0
amd
Top achievements
Rank 1
answered on 04 Feb 2021, 04:40 PM

got sane issue 

 

response is {"name":"Folder","isDirectory":true,"hasDirectories":false,"path":"folder","extension":" ","size":0,"created":"2021-02-04 22:07:12","createdUtc":"2021-02-04 22:07:12","modified":"2021-02-04 22:07:12","items":null}

0
Ivan Danchev
Telerik team
answered on 08 Feb 2021, 12:01 PM

Hello,

If you are using the MVC FileManager, change the names of the fields so that they start with capital letters (see my previous reply).

Regards,
Ivan Danchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
FileManager
Asked by
Doran
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
amd
Top achievements
Rank 1
Share this question
or