How open folder through API

I have 4 folders named A,B,C,D. do you have any API's to open/double click folder B through API.

I have the Item ID binded to folders

7 Replies 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team June 29, 2020 11:26 AM UTC

Hi Mahesh,  
  
Greetings from Syncfusion support. 
  
We have checked your requirement with FileManager component. We suspect that your requirement is to navigate within a folder without double clicking it. You can achieve it by passing the folder name in Path property of FileManager component, it will navigate to the corresponding folder. 
  
Refer the below link to know more about the path property. 
  
Refer the below code snippet. When clicking the toolbar item, it will navigate the corresponding folder inside the FileManager component. 
  
@(Html.EJS().Toolbar("defaultToolbar") 
    .Width("600px").Clicked("click") 
    .Items(new List<ToolbarItem> { 
        new ToolbarItem { Text="DR"}, 
        new ToolbarItem { Text="DC"}, 
        new ToolbarItem { Text="HSA" }, 
    }) 
    .Render() 
) 
    <div style="margin-top:20px"> 
        @Html.EJS().FileManager("file").AjaxSettings(new Syncfusion.EJ2.FileManager.FileManagerAjaxSettings 
                     { 
                         Url = "/Home/FileOperations", 
                         GetImageUrl = "/Home/GetImage", 
                         UploadUrl = "/Home/Upload", 
                         DownloadUrl = "/Home/Download" 
                     }).NavigationPaneSettings(ls => ls.Visible(false)).Render() 
    </div> 
<script> 
    function click(args) { 
        var filemanager = document.getElementById("file").ej2_instances[0]; 
        // Navigate to the corresponding folder. 
        filemanager.path = "/" + args.item.text; 
    } 
</script> 
  
Refer the sample link below. 
  
To know more about the TreeView component, refer the sample link. 
  
  
  
  
Please let us know, if you need any further assistance. 
  
Regards,  
Sowmiya.P 


Marked as answer

MM Mahesh Machina June 29, 2020 11:39 AM UTC

Thank you Sowmiya for quick response.

filemanager.path = "/" + args.item.text; can we set file manager path to  "/" + args.item.ID;?
 If two folders have same name then  "/" + args.item.text;  will fail. right?


SP Sowmiya Padmanaban Syncfusion Team June 30, 2020 02:51 PM UTC

Hi Mahesh,  
 
We have checked your requirement, we would like to let you know only with ID based file provider services for File Manager, you can create more than one folder/file with the same name in a path location. But, we cannot create a file/folder with same name with other file provider services which was not built based on ID field. It is the default behavior of FileManager component. 
 
Below file providers are Id based file provider services of FileManager component. 
 
Not a ID based file provider services of FileManager component. 
 
 In this F155514, you have raised a query related to SQL file provider, so we suspect that you are using ID based file provider (SQL file provider) for FileManager component.  
 
When using SQL file provider, you can create two folders/files with same name, but the ID of the two folder must be unique. By setting the Folder Id for the Path property of FileManager component, we can open the folder without double clicking it. 
 
Refer the below code snippet. 
 
<script>  
    function click(args) {  
        var filemanager = document.getElementById("file").ej2_instances[0];  
        // Navigate to the corresponding folder.  
        filemanager.path = "/6174/6178";  
    }  
</script>  
 
 
Please let us know, if you need any further assistance . 
 
Regards, 
Sowmiya.P 
 




MM Mahesh Machina June 30, 2020 03:07 PM UTC

Thanks a ton for detailed insights on how it is built. It helped


SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team July 1, 2020 10:36 AM UTC

Hi Mahesh, 
 
We are happy to hear that your issue has been resolved. Please contact us if you need any further assistance. We will be happy to help you. 
 
Regards, 
Shameer Ali Baig S. 



MM Mahesh Machina July 1, 2020 03:26 PM UTC

How to expand and show nth level menu in fixed position on button click? Please let us know

Please refer attached file for details

Attachment: Menu_open_a868c3e4.zip


SP Sowmiya Padmanaban Syncfusion Team July 2, 2020 09:11 AM UTC

Hi Mahesh,  
 
We suggest you to follow this F155677 for further updates on your query on Menu component.  
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Loader.
Up arrow icon