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

Checkbox or Toggle Button on Toolbar

2 Answers 168 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Cary
Top achievements
Rank 2
Cary asked on 24 Nov 2008, 09:12 PM
Is it possible to add a checkbox or a toggle button to the toolbar . What we are doing is we allow uses to add comments, and they can choose whether the comment is private or public. I need a way for the user to denote that. For now I'm using a basic checkbox however since I recently incorporated a Save button into the toolbar I would like to add this feature to the tool bar as well and only have the Rad Text Box on the form.

Thank you,
Cary.


2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 27 Nov 2008, 03:42 PM
Hi Cary,

Here is an example how to create a custom toggle button:

    <style type="text/css">
    .rade_toolbar.Default .Custom1
    {
      background-image: url(http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/CustomDialog.gif);
    }
    </style>


<telerik:RadEditor id="RadEditor1" Runat="server">
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="Custom1" />
        </telerik:EditorToolGroup>
    </Tools>
    <ImageManager ViewPaths="~/" UploadPaths="~/" />
    <Content>
        <div style="float: left"><img alt="" src="/aspnet/prometheus/Editor/Img/UserDir/PublicRelations/4.jpg" /></div>
    </Content>
</telerik:RadEditor>

<script type="text/javascript">
RadEditorCommandList["Custom1"] = function(commandName, editor, oTool)
{     
    var tool = oTool.get_tool().get_element();
   
    if (tool.flag)
    {
        alert("Highlighted button");
        oTool.get_tool().setState(0)
        tool.flag = false;
       
    }
    else
    {
        alert("Normal button");
        oTool.get_tool().setState(1)
        tool.flag = true;
    }
    
};
</script> 

For your convenience I have attached my test page.


Sincerely,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Cary
Top achievements
Rank 2
answered on 01 Dec 2008, 02:56 PM
Thank you! This helps a ton!
Tags
Editor
Asked by
Cary
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Cary
Top achievements
Rank 2
Share this question
or