Javascript 无法在queuecomplete上检索dropzone节点?

Javascript 无法在queuecomplete上检索dropzone节点?,javascript,jquery,dropzone.js,Javascript,Jquery,Dropzone.js,我想检索dropzone的节点,该节点已完成上载队列。同一页面上有多个节点,但我遇到了困难 var dropzone = new Dropzone("#" + dz_id, { autoProcessQueue: true, url: url + endpointFileMgr, headers:{"APIKey":APIKey, "IndexUUID": Indexes[i].IndexUUID,"

我想检索dropzone的节点,该节点已完成上载队列。同一页面上有多个节点,但我遇到了困难

var dropzone = new Dropzone("#" + dz_id, {
                autoProcessQueue: true,
                url: url + endpointFileMgr,
                headers:{"APIKey":APIKey, "IndexUUID": Indexes[i].IndexUUID,"Cache-Control": "",},
                maxFilesize: 1024, //MB
                queuecomplete: function(e){
                    // alert("e innerHTML " + e.innerHTML); // No Alert, Console Error "Cannot read property 'innerHTML' of undefined"
                    //alert("e.target.innerHTML " + e.target.innerHTML); // No Alert, Console Error "Cannot read property 'target' of undefined"
                    alert ("this.innerHTML " + this.innerHTML); // Alert's 'this.innerHTML undefined'
                    alert("$(e).html()" + $(e).html()); // Alert's '$(e).html() undefined'
                    //alert("$(this).html()" + $(this).html()); // No Alert, Console Error "Cannot read property 'createDocumentFragment' of undefined"
                    //alert ("$(dropzone).html() " + $(dropzone).html()); // No Alert, Console Error "Cannot read property 'createDocumentFragment' of undefined"
                    alert(e.currentTarget.innerHTML); // No alert, "Cannot read property 'currentTarget' of undefined"
                }
            });
我在一个循环中以编程方式创建多个Dropzone,这就是为什么我将选项作为一个对象传递,而不是像Dropzone文档中建议的那样事后访问

建议所有事件都应该传递一个事件参数,根据我的理解,我应该能够从该参数或“this”检索接收事件的节点。。。或者在某个地方,但我的理解似乎有缺陷

有人能给我解释一下,正确的方法是什么吗?

当您定义queuecomplete选项时,如:

{
  // .....
  queuecomplete: function(e) {
    // ---
  }
}
在这种情况下,您要做的是覆盖dropzone在queuecomplete上自己的行为,除非您真的想这样做,否则您应该将自己的事件侦听器连接到queuecomplete事件,如下所示:

var dropzone = new Dropzone("#" + dz_id, {
  autoProcessQueue: true,
  url: url + endpointFileMgr,
  headers: {
    APIKey: APIKey,
    IndexUUID: Indexes[i].IndexUUID,
    "Cache-Control": ""
  },
  maxFilesize: 1024, //MB
  init: function() {

    let thisDropzone = this;

    this.on("queuecomplete", function() {
      alert(thisDropzone.element.innerHTML);
    });
  }
});