Kendo FileManager Path is not working and cannot get path

1 Answer 69 Views
FileManager
Stark
Top achievements
Rank 1
Iron
Iron
Stark asked on 07 May 2021, 01:38 PM | edited on 07 May 2021, 01:40 PM

I tried using the following demo tutorials But path of my folder didn't get and not working

Link demo: https://docs.telerik.com/kendo-ui/api/javascript/ui/filemanager/methods/path

This is My Code FileManager:


Image 1 :  When click each Folder, Console show yellow message

Image 2 : My Json data Url Read call

 


$("#fileManager").kendoFileManager({
        
        dataSource: {
            schema: {
                data: 'data'
            },
            transport: {
                read: function(options) {
                    var that = this;

                    $.ajax({
                        url: " //My Url call API ",
                        dataType: "json", 
                        method: "POST",
                        data: that.parameterMap ? that.parameterMap(options.data, "read") : options.data,
                        success: function(result) {
                            options.success(result);
                        }
                    });
                },
                destroy: function(options) {
                    console.log(" Test call Function ");  // Call Function not working, cannot call
                    
                }
            }
        },
      toolbar: {
                items: [
                    { name: "custom" ..... }, // insert and upload, I use custom command
                    { name: "custum" ..... },
                    { name: "sortDirection" },
                    { name: "sortField" },
                    { name: "changeView" },
                    { name: "spacer" },
                    { name: "details" },
                    { name: "search" }
                ]
            },
            contextMenu: {
                items: [
                    { name: "rename" },
                    { name: "delete" }
                ]
            },
            draggable: true,
            resizable: true
    });

    var fileManager = $("#fileManager").data("kendoFileManager");

    fileManager.navigate("Animal");   // not target red zone folder 

    var path = fileManager.path();  //not show log

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 12 May 2021, 09:53 AM

Hello Stark,

I would suggest you use the navigate method either in a setTimeout function or in the success of the ajax for loading the data. You could also use the navigate method in the dataBound event handler with a minimal delay. Thus, you could ensure that the folders are loaded by the time you are trying to navigate to a specific one.  

 dataBound: function(e){
        setTimeout(function () { 
                  var fileManager = $("#filemanager").data("kendoFileManager");            
                  fileManager.navigate("Images");
        }, 0);
 },

Here is a Dojo example where the navigate method is called in the success of the ajax call and the FileManager successfully navigates to the needed folder. Also, the correct path is console logged.

I hope this helps.

Regards,
Neli
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Stark
Top achievements
Rank 1
Iron
Iron
commented on 12 May 2021, 10:06 AM | edited

Excuse me, Admin can answer newer question, please. This question is old. Can you have me How to Kendo ImageEditor can read dataSource
Neli
Telerik team
commented on 17 May 2021, 07:33 AM

Hi Stark,

As far as I see you have marked in the thread regarding ImageEditor that the issue is resolved. In case you have follow-up questions related to the ImageEditor, please ask them in the respective thread. This will keep the information in the threads consistent and easier to use as a reference if needed. 

Tags
FileManager
Asked by
Stark
Top achievements
Rank 1
Iron
Iron
Answers by
Neli
Telerik team
Share this question
or