This is a migrated thread and some comments may be shown as answers.

Toolbar in preview mode, accessing toolbar buttons

0 Answers 51 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 03 Jan 2011, 02:37 PM
Hi, 
I have some questions regarding toolbar in MOSSradEditor.
1. When the MOSSRadEditor is the only control on the page, or for any other reason has the focus as soon as it is loaded the toolbar is always shown, even when the editor is set to have only the preview mode:

editorPreview.EditModes = EditModes.Preview;

Adding the following client-side script doesn't help either:

    <script type="text/javascript" language="javascript">
        function Editor_ClientLoad(editor, args) {
            editor.set_mode(4);
            editor.set_editable(false);
            editor.enableEditing(false);
        }
   </script>

What is your suggestion to solve this issue?

2. I would like to make some toolbar buttons invisible as soon as the editor is selected, hence the toolbar is shown. I use the following client side code:
        function Editor_ClientLoad(editor, args) {
            editor.attachEventHandler("onmousedown", function(e) {
        var oTool = this.Editor.getToolByName("buttonName"); //get a reference to the custom tool
        if (oTool == null)
            return;
        oTool.set_visible(false); 
            });
}
After the first mouse click, toolbar buttons are not yet accessible, in other words oTool==null. After the second click it works fine.
How can I solve this problem, Can you suggest a better way to get the same results?

3. If there are two or more toolbars defined for a single editor, how can we get a reference to the toolbar causing the client side event "OnClientCommandExecuting" in the corresponding evand handler?

I appreciate your reponse.
Regards,
Ali.

No answers yet. Maybe you can help?

Tags
ToolBar
Asked by
Ali
Top achievements
Rank 1
Share this question
or