filemanager menu customization

I need the following behaviour.

when user right clicks on file, We need to show “upload version” menu item, once the user click on create version item, need to show popup with uploader.

when the user clicks on empty content in grid view, We need to show “upload” menu item.

How this can be possible to show menu item based on file click or empty right click

Hello,

If you just need to display different titles for the “upload” menu item, you can implement in within the menuFilter handler. It is called each time the menu is about to be shown.

menuFilter:function(obj){
    //menu object
    var menu = $$("files").getMenu();
    
    //information about the clicked item in the File Manager
    var context = menu.getContext();
    
    if(obj.id == "upload"){
      var value = context.id?"Upload version":"Upload";
      menu.updateItem(obj.id, {value:value})
    }
    return true;
  }

http://webix.com/snippet/a5ac097c

You can also check the documentation of the “actions” menu.

Thanks for reply.

I need to show behaviour differently

  1. If user right clicks on doc/pdf file, we need to show “upload version” menu item.
  2. if user right clicks on folder. we need to show “upload” menu item

Then you can get the data item object and access its type property to set the necessary menu item text.

http://webix.com/snippet/1aeb3d8c