We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how can I change the default methods of tools?

Thread ID:

Created:

Updated:

Platform:

Replies:

130076 Apr 20,2017 03:11 AM UTC Apr 21,2017 12:01 PM UTC JavaScript 3
loading
Tags: ejFileExplorer
tmzl
Asked On April 20, 2017 03:11 AM UTC

I would like to change the default methods of tools like "createFolder", and I would like to click on "createFolder" to open my own url,Where i can customize it?

Karthik Ravichandran [Syncfusion]
Replied On April 20, 2017 12:21 PM UTC

Dear Customer, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query. You can achieve your requirement using toolList and tools API of ejFileExplorer. Please refer the below code block. 
 
[script] 
var toolsList = ["layout", "creation", "navigation", "addressBar", "editing", "copyPaste", "getProperties", "customTool", "searchBar"]; 
var tools = ej.FileExplorer.prototype.defaults.tools; 
tools.customTool = [{ 
    name: "Help", 
    tooltip: "Help ", 
    css: "e-fileExplorer-toolbar-icon Help", 
    action: function () { 
        window.open("https://help.syncfusion.com/js/fileexplorer/toolbar#custom-tool-in-toolbar") 
    } 
}]; 
 
$("#fileExplorer").ejFileExplorer({ 
    toolsList: toolsList, 
    tools: tools, 
    path: "http://js.syncfusion.com/demos/ejServices/Content/FileBrowser/", 
    ajaxAction: "http://js.syncfusion.com/demos/ejServices/api/FileExplorer/FileOperations", 
}); 
 
 
For your convenience, we have attached the sample below, 
 
 
To know more details about ejFileExplorer, please refer the below link. 
 
 
 
 
Please let us know if you need further assistance on this. 
 
Regards, 
Karthik R 


tmzl
Replied On April 20, 2017 03:01 PM UTC

Thanks for reply,I know to use customTool, but if i need multiple customTool, and i need a place on the new folder, the other is placed in front of the details。




Karthik Ravichandran [Syncfusion]
Replied On April 21, 2017 11:55 AM UTC

Dear Customer, 
 
Thanks for your update. 
 
You can achieve your requirement in ejFIleExplorer Create event by moving the created custom tool element using insertAfter method in jQuery. Please refer the below code block. 
 
$(function () { 
    $("#fileExplorer").ejFileExplorer({ 
        isResponsive: true, 
        width: "100%", 
        minWidth: "150px", 
        fileTypes: "*.png,*.gif,*.jpg,*.jpeg,*.docx", 
        toolsList: toolsList, 
        layout: "largeicons", 
        tools: tools, 
        create : "onCreate" 
    }); 
 
}); 
 
function onCreate(args){ 
    $(this._toolBarObj.items).filter($('li#' + this.element.attr('id') + 'CreateFolder').insertAfter("ul li:eq(0)") ) 
} 
 
 
For your convenience, we have attached the sample below. 
 
 
Please let us know if you need further assistance on this. 
 
Regards, 
Karthik R 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;