I created two new tool buttons to the RadEditor by using this code:
<telerik:EditorToolGroup>
<telerik:EditorTool Name="RTL" Text="RTL" ShowText="true" ShowIcon="false" Width="25px" />
<telerik:EditorTool Name="LTR" Text="LTR" ShowText="true" ShowIcon="false" Width="25px" />
</telerik:EditorToolGroup>
I am looking for these commands to change the editor style from a Left-To-Right style to Right-To-Left style.
The styles work fine when I change them from C# code behind.
But I am unable to attach code behind events to the new Editor Tools (As there a way to do so???) so I try using the following JavaScript code: (As seen in your samples).
<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList["RTL"] = function(commandName, editor, args) {
editor.DialogsCssFile = "Styles/RadEditor_Dialogs_RTL.css";
editor.ContentAreaCssFile = "Styles/EditorContentArea_RTL.css";
alert('RTL');
};
Telerik.Web.UI.Editor.CommandList["LTR"] = function(commandName, editor, args) {
editor.DialogsCssFile = "";
editor.ContentAreaCssFile = "";
alert('LTR');
};
</script>
The code gets called alright, but has no effect on the editor style.
(If I run similar code from the code behind the styles work, but I need the code to execute via the new tool buttons)
I'd appreciate any help you can provide.
<telerik:EditorToolGroup>
<telerik:EditorTool Name="RTL" Text="RTL" ShowText="true" ShowIcon="false" Width="25px" />
<telerik:EditorTool Name="LTR" Text="LTR" ShowText="true" ShowIcon="false" Width="25px" />
</telerik:EditorToolGroup>
I am looking for these commands to change the editor style from a Left-To-Right style to Right-To-Left style.
The styles work fine when I change them from C# code behind.
But I am unable to attach code behind events to the new Editor Tools (As there a way to do so???) so I try using the following JavaScript code: (As seen in your samples).
<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList["RTL"] = function(commandName, editor, args) {
editor.DialogsCssFile = "Styles/RadEditor_Dialogs_RTL.css";
editor.ContentAreaCssFile = "Styles/EditorContentArea_RTL.css";
alert('RTL');
};
Telerik.Web.UI.Editor.CommandList["LTR"] = function(commandName, editor, args) {
editor.DialogsCssFile = "";
editor.ContentAreaCssFile = "";
alert('LTR');
};
</script>
The code gets called alright, but has no effect on the editor style.
(If I run similar code from the code behind the styles work, but I need the code to execute via the new tool buttons)
I'd appreciate any help you can provide.