我想在加载elFinder时自动打开“上传文件”对话框。我发现这个函数是在elFinder加载之后运行的,但是我不能绑定或调用upload命令。
$('selector').elfinder({
// options ...
handlers : {
load : function(event, elfinder) {
console.log(elfinder);
}
}
});发布于 2013-08-07 03:38:07
我遇到了同样的问题,没有关于这方面的文档,所以在一些混乱之后,这是我的解决方案。
首先你需要获取elfinder的实例:
elf1 = $('#fexplorer').elfinder({...options...});
elf=elf1.elfinder('instance');当你拥有它的时候,你可以这样调用任何命令:
elf.exec('upload');发布于 2019-01-31 22:18:48
您应该请求命令并执行它!它适用于elFinder (2.1.46)
var _elFinder = $("#finder").elfinder(
{url : '/processAdmin/connector/' + idProceso,
lang: 'es',
width:'auto',
height:200,
commands: ['rename','upload'],
ui:[],
disabled:['extract', 'archive', 'mkdir'],
sortStickFolders:true,
resizable:false,
customData : {'numDocumento':numDocument}
},
function(fm, extraObj) {
// `init` event callback function
setTimeout(function() {
elf = _elFinder.elfinder('instance');
cmd = elf._commands['upload'];
cmd.exec();
}, 500);}
);发布于 2019-02-26 23:06:57
在执行第一个open命令后执行upload命令。
$('selector').elfinder({
// options ...
handlers : {
load : function(event, elfinder) {
elfinder.one('open', function() {
elfinder.exec('upload');
});
}
}
});https://stackoverflow.com/questions/17673563
复制相似问题