Dropzone.options.imageFile = {
url: HOST_NAME + USER_NAME + BUILDER_API +'image/',
method: 'POST',
// enter code here
acceptedFiles: '.jpg, .jpeg, .png',
paramName: "imagefile", // The name that will be used to transfer the file
maxFilesize: 10, // MB
//addRemoveLinks: true,
maxFiles: 2,
init: function() {
this.on("success", function(file, response) {
image_id = response.id;
IMAGES.push(image_id);
check_files();
}),
this.on("removedfile", function(file, response){
data = JSON.parse(file.xhr.response);
alert(data['id']);
});
},
};
我需要做什么才能完全重置放置区?
不能 100% 确定我理解了这个问题,但我认为您希望能够从原始状态重用 dropzone 实例。
从技术上讲你想打电话removeAllFiles()
这将删除所有文件。
以下示例向您展示了如何通过一键添加和删除所有文件:一键删除所有文件 https://github.com/enyo/dropzone/wiki/Remove-all-files-with-one-button
此外,还有其他人试图做与您正在寻找的相同的事情:将拖放区重置为原始状态 https://github.com/enyo/dropzone/issues/44
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)