Hi there
I am using webix filemanager (v 5.2.1 pro) that works excellently, but I am having trouble with setting up the onErrorResponse handler.
When there is an error uploading a file, I am returning
json_encode(false)
which shows the error “Error: changes were not saved”. Fine.
The problem is that if another file is then dropped to the filemanager, it spins forever and the error message remains. (even thought the new file was successful)
I would like to prompt the user to re-upload the file, and reload the page to remove the error message. I am using this handler:
fManager.attachEvent("onErrorResponse", function(requestData,response){
console.log(requestData + " " +response);
webix.confirm("There was an error uploading the file, please try again.").then(function(result){
window.location.reload();
}).fail(function(){
window.location.reload();
});
});
The problem is, this never fires and nothing is logged to console.
here is the entire webix code I am using:
webix.ready(function () {
let fManager = new webix.ui({
view: "filemanager",
container: "filemanager",
handlers: {
"branch": "/api/fm_data_branch.php",
"upload": "/api/fm_upload.php",
"download": "/api/fm_download.php",
"copy": "/api/fm_copy.php",
"move": "/api/fm_move.php",
"remove": "/api/fm_remove.php",
"rename": "/api/fm_rename.php",
"create": "/api/fm_create.php"
}
});
fManager.hideTree();
fManager.load("/api/fm_data.php");
let actions = fManager.getMenu();
actions.remove("copy");
actions.remove("cut");
actions.remove("paste");
actions.remove("create");
actions.remove("remove");
actions.remove("edit");
fManager.attachEvent("onErrorResponse", function(requestData,response){
console.log(requestData + " " +response);
webix.confirm("There was an error uploading the file, please try again.").then(function(result){
window.location.reload();
}).fail(function(){
window.location.reload();
});
});
})
Can someone please point me in the right direction?
Thanks
~mokiscott