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.
What is wrong I need help. Thanks.
Regards,
Michael
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