当我使用没有敲除绑定的dropzone时,它工作正常但是当我使用敲除绑定时它可以工作但不应用设置(像autoProcessQueue:false这样的选项)。
我的HTML代码是:
<form id="my-awesome-dropzone" class="dropzone" action="@Url.Action("FileUploadHandler", "Electronics")" method="post" enctype="multipart/form-data">
<div data-bind="text:name"></div>
<input type="text" name="myName" />
<div id="dropzonePreview" class="dz-default dz-message">
</div>
</form>
我的Js代码是:
function VM() {
var self = this;
self.name = ko.observable("Irfan");
};
$(document).ready(function () {
ko.applyBindings(new VM());
Dropzone.options.myAwesomeDropzone = {
autoProcessQueue: false,
uploadMultiple: true,
parallelUploads: 100,
maxFiles: 100,
addRemoveLinks: true,
clickable:'#dropzonePreview',
init: function () {
var myDropzone = this;
this.element.querySelector("button[type=submit]").addEventListener("click", function (e) {
e.preventDefault();
e.stopPropagation();
myDropzone.processQueue();
});
}
}