问题
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