Ajax Control Toolkit HTML Editor setup task?

How to change default setting for ACT HTML editor? I want to load an editor, for example, a highlighted highlighted dedicated button or using the rtl direction instead of the default ltr.
How can i do this? I overridden the method FillTopToolbar()to add custom buttons, but I don't know how to change the default settings.
how the default value of ltr is selected. I want to change it to rtl.

+3
source share
2 answers

I edited my answer to fix some things

HTMLEditor . Sys.Application.load Event. , , , , .

, , rtl. , :

// Attach a handler to the load event.
Sys.Application.add_load(myOnLoadLoader);

function myOnLoadLoader() {
    //This will run JUST after ALL code that was set to run during the load event has run
    window.setTimeout(myOnLoad, 0);
}

function myOnLoad() {
    var editor = $find('<% =editor.ClientID %>');
    var toolbar = editor.get_changingToolbar();
    var toolbarButtons = toolbar.get_buttons();
    for (var i = 0; i < toolbarButtons.length; i++) {
        var toolbarButton = toolbarButtons[i];
        if (toolbarButton instanceof AjaxControlToolkit.HTMLEditor.ToolbarButton.Rtl ||
        toolbarButton instanceof AjaxControlToolkit.HTMLEditor.ToolbarButton.Bold) {
            toolbarButton.set_activeEditPanel(editor.get_editPanel());
            toolbarButton.callMethod();
        }
    }
}

Sys (, , Sys.Application) - , javascript ASP.Net AJAX (, ScriptManager, ). , , Sys.Application.add_load(myOnLoad); ASP.Net AJAX. :

  • script , scriptManager.
  • script JS ScriptManager ().

script , , var editor = $find('<% =youreditor.ClientID %>'); . , javascript ( aspx). , <% =youreditor.ClientID %>.

, :

aspx ( ):

<script language="javascript">
    var myEditorId = '<%= youreditor.ClientID %>';
</script>

, :

<head runat="server">
    <script language="javascript">
        var myEditorId = '<%= youreditor.ClientID %>';
    </script>
<title></title>
</head>

( , script ScriptManager )

JS

var editor = $find('<% =youreditor.ClientID %>');

var editor = $find(myEditorId);
+5

CSS, rtl . CSS rtl -

div
{
    direction:rtl;
}

HTML Editor.css.

0

Source: https://habr.com/ru/post/1728299/


All Articles