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

Get button state

1 Answer 45 Views
Editor
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 14 Jul 2008, 04:16 PM
Hi

I know we can use the following to set the button state:

editor.getToolByName(

"myButton").setState(-1);

But is there a way to GET it's state? I've tried a couple of things but no luck.

Thanks
David

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 15 Jul 2008, 07:35 AM
Hello David,

You can use the isOn() method to see whether the button is clicked:

editor.getToolByName("myButton").isOn();

You can see the rest of the button methods using the debugger

<script type="text/javascript"> 
 function OnClientLoad(editor, args) 
 {               
    var button = editor.getToolByName("myButton");
    debugger;
 }        
</script>
<telerik:radeditor runat="server" ID="RadEditor1"  
     OnClientLoad="OnClientLoad"
     Height="400px"> 
        <Tools>
            <telerik:EditorToolGroup>
                <telerik:EditorTool Name="myButton" Text="myButton" />
            </telerik:EditorToolGroup>               
        </Tools>                     
    </telerik:radeditor>

Sincerely yours,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
David
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or