tags:

views:

12

answers:

1

Hi,

I am stuck with an tiny issue with the tinyMce, and this is very urgent. In very brief, from tinyMce callback I get an tinyMce instance. Now I want to use this instance to set text-direction from "ltr" to "rtl" on the fly. But I don't seem to find and set the required property. Following is what I'm trying to do :

$('textarea.tinymce').each(function () {
    $(this).tinymce({
       init_instance_callback : "setDirection"
    });
});

function setDirection(inst) {
      inst.directionality = "rtl";
}

Any help would be greatly appreciated.

Thanks.

A: 

First: init_instance_callback is deprecated as of TinyMCE3.x! You might want to use the setup callback option instead.

Second: You can use the following code to easily apply the direction you want:

editor.getBody().dir = 'rtl'; // editor is a tinymce editor instance
Thariama
I really appreciate your reply, thanks. I found another work-around and it worked. I will try yours as well. Thanks :)
Gurdeep
please let other users know what you did - it might be helpfull to them too
Thariama