select and return an array of selected files in elfinder

血红的双手。 提交于 2019-12-11 11:21:47

问题


I'm using elFinder file manager. that is great and easy to use.

that has multi select files capability . but I want to use it for select some files then by pressing enter keyboard button, path of those files Be returned as an Javascript Array.

This is My code to initialize elFinder instance :

$('.add-item').on('click', function () {

    var filesArr = [];

    $('<div id="editor" />').dialogelfinder({
        url: './elfinder/php/connector.minimal.php',
        getFileCallback: function (file) {
            $('#editor').dialogelfinder('close');
            console.log(file.url);
        }
    });


});

that works when select one file but when user select multi files and press enter, all selected files opens for preview only.

How can I do that?


回答1:


You can configure behaviour of getFileCallback with 'commandsOptions'. In your case you need to alter multiple property and set it to true

commandsOptions : {
     getfile: {
        multiple: true
     }
}


来源:https://stackoverflow.com/questions/35959598/select-and-return-an-array-of-selected-files-in-elfinder

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