The user can add any user-defined handler to any of the available events. To do this, the user can use the attachEvent method with the following parameters:
webix.attachEvent(evName, evHandler);
Several handlers can be attached to one and the same event, and all of them will be executed. The names of the events are case-insensitive.
There is a simple way of removing an event-handler:
webix.detachEvent(id); // unique id of the event handler
The File Manager API includes the following groups of events:
1) Actions handling events
2) Drag-n-drop Events
3) Editing events
4) Other
fires before an item has been marked for copying
$$("fmanager").attachEvent("onBeforeMarkCopy", function(ids){
// your code
return true;
});
params:
returns:
Related sample: Copy, Cut, Paste Events
fires before a new folder has been created
$$("fmanager").attachEvent("onBeforeCreateFolder",function(id){
// your code
return true;
});
params:
returns:
fires before an item has been marked for cutting
$$("files").attachEvent("onBeforeMarkCut", function(ids){
// your code
return true;
});
params:
returns:
Related sample: Copy, Cut, Paste Events
fires before an item is deleted
$$("fmanager").attachEvent("onBeforeDeleteFile",function(id){
// your code
return true;
});
params:
returns:
fires when the Rename action is chosen in the popup menu
$$("fmanager").attachEvent("onBeforeEditFile",function(id){
// your code
return true;
});
params:
returns:
Related sample: Editing Events
fires before an item has been pasted
$$("fmanager").attachEvent("onBeforePasteFile", function(ids){
// your code
return true;
});
params:
returns:
Related sample: Copy, Cut, Paste Events
fires on "upload" action click
$$("fmanager").attachEvent("onBeforeUploadFile",function(targetId){
// your code
return true;
});
params:
returns:
fires after drag-n-drop has been finished
$$("fmanager").attachEvent("onAfterDrop",function(context,ev){
// your code
return true;
});
params:
fires before drag-n-drop has started
$$("fmanager").attachEvent("onBeforeDrag",function(context,ev){
// your code
return true;
});
params:
returns:
fires before a dragged item is moved over the droppable area
$$("fmanager").attachEvent("onBeforeDragIn",function(context,ev){
// your code
return true;
});
params:
returns:
fires before a dragged item is released over the droppable area
$$("fmanager").attachEvent("onBeforeDrop",function(context,ev){
// your code
return true;
});
params:
returns:
fires after the edtor is closed
$$("fmanager").attachEvent("onAfterEditStop",function(id,state,editor,view){
// your code
return true;
});
params:
Related sample: Editing Events
fires before editing is finished
$$("fmanager").attachEvent("onBeforeEditStop",function(id,state,editor,view){
var newValue = state.value
if(...){
return false;
}
return true;
});
params:
returns:
Related sample: Editing Events
fires if an error has occured during some operation
$$("files").attachEvent("onErrorResponse", function(requestData,response){
var action = requestData.action;
// your code
return true;
});
params:
Related sample: onErrorResponse Event
fires before a selected file is downloaded
$$("fmanager").attachEvent("onBeforeRun",function(id){
webix.confirm({
text:"Do you want to download this file?",
ok:"Yes",
cancel:"No",
callback:function(result){
if(result)
$$("files").download(id);
}
});
return false;
});
params:
returns:
Related sample: onBeforeRun event
fires on selecting a folder in the Tree view
$$("fmanager").attachEvent("onFolderSelect",function(id){
// your code
});
params:
Related sample: Folder Selection
fires during the initialization of an object with the mode configuration
$$("fmanager").attachEvent("onViewInit": function(id, config){
// disable multi-selection for "table" and "files" views
if (id == "table" || id == "files"){
config.select = true;
}
});
params:
Related sample: Changing View Configuration
Back to top