Enabling Print button in Preview mode

Article Info

Rating: Not rated

Article information

Article relates to

 RadEditor for ASP.NET AJAX
 Telerik.Web.UI

Created by

 Rumen Zhekov


HOW-TO
Enable Print button in Preview mode

SOLUTION
The code below demonstrates how to enable the Print button in Preview mode of RadEditor. It checks whether the current mode of RadEditor is Preview using the get_mode() method, after that it gets a reference to the "Print" tool using the getToolByName() method and enables it using the setState(0) method, e.g.

<telerik:radeditor runat="server" OnClientModeChange="OnClientModeChange" ID="RadEditor1"></telerik:radeditor>
<script type="text/javascript">
   function OnClientModeChange(editor, args)
   {
       var mode = editor.get_mode();                     
       switch (mode)
       {
           case 1:
               //alert( "We are in Design mode");
               //do something
           break;
           case 2:
               //alert("We are in HTML mode");
           break;
           case 4:
               setTimeout(function()
               {
                   var tool = editor.getToolByName("Print");
                   tool.setState(0);
               }, 0);
               //alert( "We are in Preview mode");
               //do something
           break;
       }
   }
 </script>

Comments

There are no comments yet.
If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.