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

Enabel/Disabel Toolbarbuttons

1 Answer 25 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Michael Stöcklin
Top achievements
Rank 1
Michael Stöcklin asked on 13 Feb 2011, 03:54 PM
Hi,
How can toolbarbuttons in RadEditor be enabled and disabled according to current selection. RadEditor is using toolsfile for configuring the toolbarbuttons. The sample from documentation for "OnClientSelectionChange" trying for example to enable/disable "InsertRowAbove" button does not work.

function OnClientSelectionChange(editor, args) {
    var selElem = editor.getSelection().getParentElement();  //return the currently selected object in the content area
    var oTool = editor.getToolByName("InsertRowAbove"); //get a reference to the custom tool
    if (selElem.tagName == "TD")  //if the selected element is of image type, make the tool's icon active
    {
        oTool.setState(0); //Enable Tool Icon
    }
    else {
        oTool.setState(-1); //Disable Tool Icon
    }
}


<telerik:RadEditor ID="RadEditor1" runat="server" Skin="Default" OnClientSelectionChange="OnClientSelectionChange"
                        ContentAreaMode="Div" Height="600px" Width="700px" ToolsFile="~/Admin/Form/Controls/DefaultTools.xml">

What is wrong I need help. Thanks.

Regards,
Michael

1 Answer, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 16 Feb 2011, 04:42 PM
Hello Michael,

The solution in this help article is provided for the default IFRAME mode of the content area of RadEditor. I logged for implementation in our PITS system. I also updated your Telerik points for your feedback.
Currently, you can use it only by setting ContentAreaMode="iframe".

Kind regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Editor
Asked by
Michael Stöcklin
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or