how to disable tool icons on button click

6 posts, 0 answers
  1. srinivas
    srinivas avatar
    27 posts
    Member since:
    Aug 2008

    Posted 25 Aug 2008 Link to this post

    Hi,

    I need to disable some of the toolbar icons(Eg: Bold and Italic) on the RadEditor on button click and i should hide these on clientside .how can i achieve this.


    Thanks
    Srinivas
  2. Rumen
    Admin
    Rumen avatar
    13748 posts

    Posted 25 Aug 2008 Link to this post

    Hi Srinivas,

    Please, review the following help article on the topic: Set Button State.


    You can hide a toolbar button on the client using the getToolByName() method of the editor, e.g.

    var oTool = editor.getToolByName("Bold"); //get a reference to the custom tool
    oTool.get_element().style.display = "none";


    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. srinivas
    srinivas avatar
    27 posts
    Member since:
    Aug 2008

    Posted 25 Aug 2008 Link to this post

    Hi,

    I tried the given solution. Actually i have telerik icons as well as custom icons.so when i hide the telerik icons,I am seeing a large space between remaining telerik icons and custom icons.this is due to their visibility that was set to false.so it made the RadEditor looking ugly.Please suggest a way to disable the icon rather than keeping it hide.


    THanks
    Srinivas
  4. Rumen
    Admin
    Rumen avatar
    13748 posts

    Posted 25 Aug 2008 Link to this post

    Hi,

    Did you tried the provided solution in the help article and use the setState(-1) method?

    If you are unable to implement the requested scenario, open a support ticket and send a sample working project that demonstrates the problem.

    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Mahesh Mungarwadi
    Mahesh Mungarwadi avatar
    1 posts
    Member since:
    Apr 2010

    Posted 29 Aug 2011 Link to this post

    hi,

    I have a requirement where I would like to hide/show the tools like "LinkManager" and "unlink" from tools in radeditor
    based on the toggling of the radio buttons present in the web page.

    so when i choose one radio button it should hide the couple of tools and show when i select another radio button.

    I tried accessing the radeditor id onclick of radio button with javascript/jquery no luck.

    kindly let me know how to achieve this.


    Thanks
    Mahesh
  6. Rumen
    Admin
    Rumen avatar
    13748 posts

    Posted 31 Aug 2011 Link to this post

    Hello Mahesh,

    Here is an example how to hide the Bold tool on the client:
    <telerik:RadEditor ID="RadEditor1" runat="server">
        <Tools>
            <telerik:EditorToolGroup>
                <telerik:EditorTool Name="Bold" />
                <telerik:EditorTool Name="Italic" />
            </telerik:EditorToolGroup>
        </Tools>
    </telerik:RadEditor>
    <input type="radio" name="Hide Bold" value="Bold" onclick="hideTool('Bold')" />Hide Bold <br />
    <script type="text/javascript">
        function hideTool(tool) {
            var editor = $find("<%=RadEditor1.ClientID%>");
            editor.getToolByName(tool).get_element().style.display = "none";
        }
    </script>

    You can use the code above as a base to proceed with your custom implementation.

    Best regards,
    Rumen
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top