admin管理员组

文章数量:1432187

I am not able to add custom config file to ckeditor in grails.
Here is my code:

function applyEditor() {
    try {

        CKEDITOR.replace('editor1', {
            customConfig : '../ckeditor/custom_config.js',

            toolbarGroups : [ {"name" : "basicstyles",
                "groups" : [ "basicstyles", "cleanup" ]
            }, {
                "name" : "links",
                "groups" : [ "links" ]
            }, {
                "name" : "insert",
                "groups" : [ "insert" ]
            }, {
                "name" : "paragraph",
                "groups" : [ "list", "blocks", "align" ]
            },
            {
                "name" : "styles"
            },
            {
                "name" : 'colors'
            }, {
                "name" : 'editing',
                "groups" : [ 'find', 'selection', 'spellchecker' ]
            }, ],
            removeButtons : 'Image,Flash,Iframe'
        });
    } catch (e) {
        // TODO: handle exception
    }
}

Custom_config.js is placed under /target/work/plugins/ckeditor-4.4.1.0/web-app/js/ckeditor/custom_config.js

Please help me out. Thanx in advance.

I am not able to add custom config file to ckeditor in grails.
Here is my code:

function applyEditor() {
    try {

        CKEDITOR.replace('editor1', {
            customConfig : '../ckeditor/custom_config.js',

            toolbarGroups : [ {"name" : "basicstyles",
                "groups" : [ "basicstyles", "cleanup" ]
            }, {
                "name" : "links",
                "groups" : [ "links" ]
            }, {
                "name" : "insert",
                "groups" : [ "insert" ]
            }, {
                "name" : "paragraph",
                "groups" : [ "list", "blocks", "align" ]
            },
            {
                "name" : "styles"
            },
            {
                "name" : 'colors'
            }, {
                "name" : 'editing',
                "groups" : [ 'find', 'selection', 'spellchecker' ]
            }, ],
            removeButtons : 'Image,Flash,Iframe'
        });
    } catch (e) {
        // TODO: handle exception
    }
}

Custom_config.js is placed under /target/work/plugins/ckeditor-4.4.1.0/web-app/js/ckeditor/custom_config.js

Please help me out. Thanx in advance.

Share Improve this question edited Jul 28, 2015 at 12:37 Murtaza Munshi 1,0854 gold badges14 silver badges40 bronze badges asked Jul 28, 2015 at 6:18 JenJen 3981 gold badge4 silver badges15 bronze badges 1
  • which version of Grails are you using? – zoran119 Commented Jul 28, 2015 at 6:29
Add a ment  | 

1 Answer 1

Reset to default 3

You are using in a right way. Check your code again. There must be some other problem. Add custom config to your ckeditor:

CKEDITOR.config.customConfig = '/your/path/ckeditor_config.js';

You can refer this for more details : LINK

本文标签: javascriptHow to add custom configjs in ckeditorStack Overflow