Hi,
I would like to support English and Arabic same time. For example, when the user enter English and Arabic text i want to get same html in javascript but the radeditor content doesn't same with the html text in javascript its like vice versa. I added screenshots about my issue.
Thank you for your quick reply.
8 Answers, 1 is accepted
Can you try to obtain the content by adding the setting the true parameter of the get_html(true) method? If there is no difference, then switch to HTML mode of RadEditor and see whether the rtl formatting is applied by inline style or is applied to the content area body element by a CSS style.
Regards,
Rumen
Progress Telerik
Hi Rumen,
I tried to get content by get_html(true) but nothing changes. It applied content body by a style i attach the screenshot.
Thank you for the research and important details!
The get_html() method obtains and returns the content only, but not the formatting of the content area. If the content contains inline styles they will be part of the string returned by the get_html(), but otherwise not.
If you want to get the formatting of the content area you can do it like this:
var
editor = $find(
"<%=RadEditor1.ClientID%>"
);
var
contentArea = editor.get_contentArea();
console.log(contentArea.style.textAlign);
Best regards,
Rumen
Progress Telerik
Hi Rumen,
I inspect the radeditor html and the body text is different than what i see on the content. H
Hi Rumen,
Sorry for the other post.
I inspect the radeditor html and the body text is different than what i see on the content. I want to get the same text on the radeditor. It shows the right txt because of 'direction:rtl' css. How can i format the text which i get from the editor?
I attach the diference between interface and real content.
The content area of RadEditor is a standard editable div/iframe element and if the formatting is not applied with inline styles to the edited content, you cannot obtain the content with the formatting since it is applied to its parent body element.
A similar problem is discussed in this article: No FONT tags are applied when I type text in the editor.
You can load the content area with some predefined paragraph element with align:right or text-align: right formatting so that this is available as content and you can obtain the content after that via the editor.get_html(true); function:
<
telerik:RadEditor
ID
=
"RadEditor1"
runat
=
"server"
>
<
Content
>
<
p
style
=
"text-align:right"
> </
p
>
</
Content
>
</
telerik:RadEditor
>
Regards,
Rumen
Progress Telerik
Hi Rumen,
This solution helps me a lot.
Thank you for your answer.
Regards,
Rumen
Progress Telerik