These forums are read-only and considered to be an archive. Please use the new Community for future interaction and posts.

Add a button in the toolbar (FileUltimate)

Two things:

I am attempting to add a new button in the FileUltimate toolbar but i am not getting results. Do you have any ideas to help me? 

Another functionality that I would like to implement is to show the url of a the file selected in the list. I would like to add a new context menu to add this functionality (any ideas?). 

Thanks a lot.
Edgar 10/3/2012 7:13 AM
You should first register a client loaded event:

<GleamTech:FileManager ID="fileManager" runat="server" ClientLoaded="fileManagerLoaded" > ...

Then in the host page you should add this javascript function:

function fileManagerLoaded(sender, eventArgs) {
    var fileManager = sender;

    fileManager.ToolBar.imagesPath = "/myimages/";
    fileManager.ToolBar.RenderItem(fileManager.ToolBar.AddSeparator());
    fileManager.ToolBar.RenderItem(fileManager.ToolBar.AddButton("TestButtonAction", "description", "newbutton.png"));
    fileManager.ToolBar.onButtonClick = function (toolBarButton, e) {
        switch (toolBarButton.action) {
            case "TestButtonAction":
                alert("Test button clicked!");
                break;
            default :
                fileManager.onAction(toolBarButton);
        }
    };

    GleamTech.JavaScript.UI.ContextMenuIconsPath["custom"] = "/myimages/";
    fileManager.ContextMenus.FileGridRow.InsertMenuItem(fileManager.ContextMenus.FileGridRow.menuItems["OpenWith"].index + 1, "TestMenuAction", "New menu item", "description", "custom:newmenuitem.png");
    fileManager.ContextMenus.FileGridRow.onMenuItemClick = function (menuItem, e) {
        switch (menuItem.action) {
            case "TestMenuAction":
                var gridRow = menuItem.menu.target;
                var selectedItemName = gridRow.GetCellValue(fileManager.GridView.columns.Name);
                alert("Test menu item clicked for item: " + selectedItemName);
                break;
            default:
                fileManager.onAction(menuItem, menuItem.menu.target);
        }
    };
}

Note that the size for toolbar images is 24x24 and for menu item images is 16x16.
I also recommend you to use Firebug on Firefox to figure out the available properties of the objects found in FileManager API.
Cem Alacayir 10/3/2012 5:43 PM
Excellent!  Thanks Cem!
Jason Vetter 10/4/2012 1:45 AM
Thanks for your help. Works nicely!
Edgar 10/4/2012 2:27 AM