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

Issue with Grid View

2 Answers 201 Views
FileManager
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Veteran
Alan asked on 29 Dec 2020, 04:47 PM

I am having an issue with the display of folders in the FileManager on initial load. If I use a local data source, everything works fine.(see Capture_local.png)

Here is an example of my local datasource:

var data = [
        {        
"name": "Training1",
"size": 0,
"path": "Training1",
"extension": "",
"isDirectory": true,
"hasDirectories": false,
"created": "2020-12-28T18:49:36.644558Z",
"modified": "2020-12-28T18:49:36.644584Z",
"createdUtc": "2020-12-28T18:49:36.644606Z",
"modifiedUtc": "2020-12-28T18:49:36.644628Z"
},
{
"name": "Training2",
"size": 0,
"path": "Training2",
"extension": "",
"isDirectory": true,
"hasDirectories": false,
"created": "2020-12-28T18:49:36.644558Z",
"modified": "2020-12-28T18:49:36.644584Z",
"createdUtc": "2020-12-28T18:49:36.644606Z",
"modifiedUtc": "2020-12-28T18:49:36.644628Z"
},
{
"name": "Training3",
"size": 0,
"path": "Training3",
"extension": "",
"isDirectory": true,
"hasDirectories": false,
"created": "2020-12-28T18:49:36.644558Z",
"modified": "2020-12-28T18:49:36.644584Z",
"createdUtc": "2020-12-28T18:49:36.644606Z",
"modifiedUtc": "2020-12-28T18:49:36.644628Z"
}
      ];

If I set the FileManager to use a remote datasource, I am getting NaN showing in the name column. (see Capture_remote.png)

The remote datasource returns the same as above.

 

Here is my FileManager config:

var filemanager = $("#fileManager").kendoFileManager({
     dataSource: filemanagerDataSource,
     height:600,
     initialView: 'grid',
     contextMenu: false,
     toolbar: {
       items: [
        { name: "sortDirection" }filemanagerDataSource,
        { name: "changeView" },
        { name: "spacer" },
        { name: "details" },
        { name: "search" }
        ]
     },
     views: {
       grid: {
         noRecords: true,
       }
     }
}).data('kendoFileManager');

 

I can set the FileManager demo (using kendo dojo) to use the grid view on initial load and it seems to work fine, so I'm not sure what may be causing the issue. Any help would be appreciated. Please let me know if more info is needed.

Thank you.

2 Answers, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 31 Dec 2020, 09:56 AM

Hi Alan,

Based on the provided details I am not sure what is causing the reported behavior. I used a mock service to return the provided data and the FileManager works as expected. You can review the example in the dojo here.

Can you modify the dojo, so the reported behavior is reproducible and send it back to me for further review? Once I observe the behavior I can be of better help in resolving the issue. You can also review the Remote DataBinding section of the documentation for additional details on the dataSource configuration requirements.

Regards,
Aleksandar
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/.

0
Alan
Top achievements
Rank 1
Veteran
answered on 04 Jan 2021, 06:15 PM

Hi,

Thanks for the response. I was not able to reproduce the issue using the example you provided. So I went back to the API where we created the json and it seems the issue was due to the way my json was being returned.

We were returning something like this:(shortened for brevity)

{"success":true,"data":[
{"name":"Training1","size":0,"path":"Training1","extension":"","isDirectory":true,"hasDirectories":false},{"name":"Training2","size":0,"path":"Training2","extension":"","isDirectory":true,"hasDirectories":false},{"name":"Training3","size":0,"path":"Training3","extension":"","isDirectory":true,"hasDirectories":false}]}

and I had set up my dataSource like this:

var filemanagerDataSource = new kendo.data.FileManagerDataSource({
schema: {
data: "data",
contentType: "application/json",
model: {
id: "path",
....

I just changed the result to return only the json and eliminated the 'data' param from the dataSource and everything looks/works like it should

Tags
FileManager
Asked by
Alan
Top achievements
Rank 1
Veteran
Answers by
Aleksandar
Telerik team
Alan
Top achievements
Rank 1
Veteran
Share this question
or