filepicker.io add options to makedrop pane

偶尔善良 提交于 2019-12-13 00:32:26

问题


Can you tell me how to set the options for the makedroppane function I cannot figure it out. Here is my example code.

I know it needs to be a dictionary array but I am not sure were to put it. In the example it just has the [0]. An example in the actual docs of the options setting would be nice.

filepicker.setKey('###########');
var options = {
    "multiple": true
};
filepicker.makeDropPane($('#exampleDropPane')[0],options, {
    dragEnter: function() {
        $("#exampleDropPane").html("Drop to upload");
    },
    dragLeave: function() {
        $("#exampleDropPane").html("Drop files here");
    },
    progress: function(percentage) {
        $("#exampleDropPane").text("Uploading ("+percentage+"%)");
        $("#pb").css('width', (percentage)+'%');
    },
    done: function(data) {
        console.log(data);
        alert('done');
    }
});

回答1:


looks like you just need to combine your options into one map:

filepicker.makeDropPane($('#exampleDropPane')[0], {
   multiple: true,
   dragEnter: function() {
    //  $("#pb").addClass('show');
    $("#exampleDropPane").html("Drop to upload");
   },
   dragLeave: function() {
    //      $("#pb").addClass('show');
    $("#exampleDropPane").html("Drop files here");
   }, ...
  });

The syntax is filepicker.makeDropPane(dropPane, options) - more information at https://developers.filepicker.io/docs/web/#local-drop



来源:https://stackoverflow.com/questions/12559123/filepicker-io-add-options-to-makedrop-pane

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!