2013-07-16 44 views
0

我想在加载elFinder时自动打开“Upload files”对话框。 我发现这个函数是在elFinder加载后运行的,但我无法绑定或调用上传命令。当elFinder加载时运行命令

$('selector').elfinder({ 
    // options ... 
    handlers : { 
     load : function(event, elfinder) { 
      console.log(elfinder); 
     } 
    } 
}); 

回答

0

我遇到了同样的问题,没有关于这方面的文档,所以经过一些搞乱这个是我的解决方案。

首先,你需要得到elfinder的实例:当你拥有它

elf1 = $('#fexplorer').elfinder({...options...}); 
elf=elf1.elfinder('instance'); 

你可以调用任何命令是这样的:

elf.exec('upload');