This is a migrated thread and some comments may be shown as answers.
Preview Mode + Floating Toolbar issue
2 Answers 14 Views
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 21 Nov 2012, 09:46 PM
Hello all,

I am using a RadEditor in where I need to enable Edit Mode or Preview Mode based on permissions (Only specific users can edit the content).

So, it is working OK but because of space, I need to use the "Floating" toolbar option.

The issue appears when I set Preview Mode + Floating Toolbar...and it is that the toolbar allows me to edit the content...If I use "Default" Toolbar mode...it appears as "grey out" and I cannot use it...achieving what I need...but if I go back to "Floating" mode, the restriction goes off.

Please let me know if you have any ideas about what could be happening.

This is what I am calling in the "OnLoad" method...

private void SetEditorMode()
       {       
           this.HelpContentRadEditor.ToolbarMode = EditorToolbarMode.Floating;
           this.HelpContentRadEditor.EditModes = EditModes.Preview;
       }


I also tried with JavaScript with no luck...

function OnClientLoad(editor, args) {
    setTimeout(function () {
        editor.set_mode(4);
    }, 150);
}


Thanks all for your help!!!

Christian

2 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 26 Nov 2012, 10:47 AM
Hi,

If the user does not have sufficient permissions you can hide the floating button or directly its toolbar using the following script:

<telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="OnClientLoad"></telerik:RadEditor>
<script type="text/javascript">
    function OnClientLoad(editor) {
        setTimeout(function () {
            var button = $telerik.$(".ToggleFloatingToolbar")[0];
            button.parentNode.parentNode.parentNode.style.display = "none";
        }, 1000);
    }
</script>


Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Christian
Top achievements
Rank 1
answered on 23 Jan 2013, 01:48 PM
It worked perfectly. I just removed the timing thing when implemented.

Thanks for your help!
Asked by
Christian
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Christian
Top achievements
Rank 1
Share this question
or