我想自定义“ dropzone.js”的删除文件方法,但是在调用服务器端后,如果发生错误,它仍然显示默认消息。看来我的文件已从this.files数组中删除。
removedfile : function (file) {
$.post($elm.data('remove-url'), p)
.done(function (rep) {
console.log(allFiles.length);
if (rep.Success) {
var _ref;
return (_ref = file.previewElement) !== null ?
_ref.parentNode.removeChild(file.previewElement) : void 0;
}
else {
//file should not be removed in client side
//but default messsage show up
showNotif(notifyType.danger, rep.Message);
return void 0;
}
})
.fail(function (e) {
return void 0;
});
};