Custom Menu Buttons, JavaScript Programming Example of Custom Menu Buttons in File Manager

JavaScript Programming Example of Custom Menu Buttons in File Manager

See the example of how you can add or remove buttons in File Manager context menu. In this programming sample, the menu has an extra download option. Feel free to use this piece of code.

JS Code

/*
The sample uses an outdated File Manager that is no longer supported. 
To learn about the new tool, visit https://docs.webix.com/desktop__filemanager.html
*/


webix.ready(function(){
  webix.ui({
    rows:[
      { view: "label", css: "header", label: "You can add or remove buttons in context menu. In this sample menu has an extra option - Download" },
      {
        view:"filemanager",
        id:"files",
        handlers:{
          "download" : "https://docs.webix.com/filemanager/samples/server/"
        },
        ready:function(){
          this.getMenu().add({
            id: "download",
            icon: "webix_icon wxi-download",
            value: "Download",
            batch: "file"
          }, 0);

          this.getMenu().add({
            $template:"Separator",
            batch:"file"
          }, 1);
        }
      }
    ]
  });

  $$("files").load("https://docs.webix.com/filemanager/samples/server/");
});

HTML Code

<style>
  .header{
  	background: #e5e5e5;
  }
  .header div{
  	padding: 0 10px;
  }
</style>