【问题标题】:Elfinder select folder as well as file in standalone popupElfinder 选择文件夹以及独立弹出窗口中的文件
【发布时间】:2015-11-05 09:32:27
【问题描述】:

我在我的一个 laravel 项目中使用 elfinder 作为文件管理器,使用 barryvdh-elfinder 包。 我正在使用它的独立弹出窗口让用户从现有文件中选择一个文件。但我希望他们也能够选择文件夹。我似乎无法让它工作。

谁能帮我解决这个问题。谢谢。

【问题讨论】:

  • 我认为这不可能。我问了same question in SO,在Elfinder的论坛里没有成功。
  • 我认为你的问题完全不同。您是否尝试过它的独立弹出窗口?您可以从 elfinder 中选择一个文件,然后在表单输入中返回文件名。我也希望能够选择一个文件夹。
  • 你是对的,对不起。你看到this documentation了吗?尝试设置folders: true
  • 哇。它工作得很好!这正是我所需要的。非常感谢:)

标签: laravel file-manager elfinder


【解决方案1】:

Tiago A. 的指导下(感谢他:))我们可以在初始化elfinder 时在commandsOptions 中使用folder : true,如下所示:

$('#elfinder').elfinder({
            // set your elFinder options here
            customData: {
                _token: '<?= csrf_token() ?>'
            },
            url: '<?= URL::action('Barryvdh\Elfinder\ElfinderController@showConnector') ?>',  // connector URL
            dialog: {width: 900, modal: true, title: 'Select a file'},
            resizable: false,
            commandsOptions: {
                getfile: {
                    oncomplete: 'destroy',
                    folders  : true
                }
            },
            getFileCallback: function (file) {
                window.parent.processSelectedFile(file.path, '<?= $input_id?>');
                parent.jQuery.colorbox.close();
            }
        }).elfinder('instance');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-13
    • 2013-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多