changing ckeditor dimension for different instances (not all instances)
Asked Answered
B

1

1

i'm trying to change dimensions for multiple ckeditor in the same page using this code just after the textarea

<script type="text/javascript">
CKEDITOR.config.width ='250px';
CKEDITOR.config.height='600px';
</script>

it changes all instances in the page and i know how to adjust default values in the config.js but i'm trying to change dimensions for some instances not all of them

Beeman answered 23/2, 2012 at 7:19 Comment(1)
Did you ever find the answer? I have the same question, found an easy workaround but not sure it's the best solution: #11124682Carnet
N
2

If you ever need to change the height of specific instance of CKEditor and all you can change is config.js, then you can use this.name inside configuration file to detect the right instance of the editor:

CKEDITOR.editorConfig = function( config ) {
    // Default height for all instances
    config.height = '400';

    // Height for specific instance, the ID of textarea is "editor1"
    if (this.name == 'editor1') {
        config.height = '200';
    }
};
Nunes answered 27/12, 2012 at 15:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.