grails elfinder plugin: preview does not work

末鹿安然 提交于 2019-12-11 04:30:00

问题


I'm using elfinder plugin in my grails project, but I have problems with preview. Infact, if I select one image (gif, png, jpeg) and I try to preview it, I only see a black window. Any suggestion about how to solve this problem?


回答1:


After several hours of digging finally got the desired result.

Problem is with the order of js inclusion. Following is my working gsp page

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/smoothness/jquery-ui.css"/>
    <link rel="stylesheet" type="text/css" href="http://elfinder.org/demo/css/elfinder.min.css"/>
</head>

<body>
    <div id="elfinder"></div>

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
    <script src="http://elfinder.org/demo/js/elfinder.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var elf = $('#elfinder').elfinder({
                url: '${g.createLink(controller: 'elfinderConnector')}'
            }).elfinder('instance');
        });
    </script>
</body>
</html>

Ref:- Issue including elFinder and JQuery UI

You can get working grails application from my git repo: elFinder Demo @GIT



来源:https://stackoverflow.com/questions/20442234/grails-elfinder-plugin-preview-does-not-work

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