Enable ToolBar Button in preview mode

11 posts, 0 answers
  1. nono
    nono avatar
    10 posts
    Member since:
    Oct 2007

    Posted 29 Dec 2009 Link to this post

    I am trying to figure out how to enable like the print button when I am in preview mode? How would this be accomplished? Thanks
  2. Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 29 Dec 2009 Link to this post

    Hi,

    You can check for the current mode using the get_mode() method, get a reference to the desired tools using the getToolByName() method and enable 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>


    You can find more information at:
    http://www.telerik.com/help/aspnet-ajax/setbuttonstate.html
    and
    http://www.telerik.com/help/aspnet-ajax/editor_get_mode.html

    Best wishes,
    Rumen
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. nono
    nono avatar
    10 posts
    Member since:
    Oct 2007

    Posted 30 Dec 2009 Link to this post

    Thanks! Exactly what i was looking for.
  5. Vincent
    Vincent avatar
    70 posts
    Member since:
    Jul 2008

    Posted 21 Mar 2010 Link to this post

    Hi

    I just encounter the same problem. When I change my editor to html view, I want to enable the "FontName", it seems dropdown stop working. I can see any value.

        function showSource(tab, multiPage, editor) { 
            editor.set_mode(2); 
            showEditorToolbar(true); 
            if (multiPage.get_selectedIndex() != 0) 
                multiPage.set_selectedIndex(0); 
     
            var oTool = getEditor().getToolByName("FontName"); //get a reference to the custom tool 
            oTool.setState(0); 
             
        } 

  6. Vincent
    Vincent avatar
    70 posts
    Member since:
    Jul 2008

    Posted 21 Mar 2010 Link to this post

    Hi

    I just encounter the same problem. When I change my editor to html view, I want to enable the "FontName", it seems dropdown stop working. I can see any value.

        function showSource(tab, multiPage, editor) { 
            editor.set_mode(2); 
            showEditorToolbar(true); 
            if (multiPage.get_selectedIndex() != 0) 
                multiPage.set_selectedIndex(0); 
     
            var oTool = getEditor().getToolByName("FontName"); //get a reference to the custom tool 
            oTool.setState(0); 
             
        } 

  7. Vincent
    Vincent avatar
    70 posts
    Member since:
    Jul 2008

    Posted 21 Mar 2010 Link to this post

    Hi

    I just encounter the same problem. When I change my editor to html view, I want to enable the "FontName", it seems dropdown stop working. I can see any value.

        function showSource(tab, multiPage, editor) { 
            editor.set_mode(2); 
            showEditorToolbar(true); 
            if (multiPage.get_selectedIndex() != 0) 
                multiPage.set_selectedIndex(0); 
     
            var oTool = getEditor().getToolByName("FontName"); //get a reference to the custom tool 
            oTool.setState(0); 
             
        } 

  8. Vincent
    Vincent avatar
    70 posts
    Member since:
    Jul 2008

    Posted 21 Mar 2010 Link to this post

    Hi

    I just encounter the same problem. When I change my editor to html view, I want to enable the "FontName", it seems dropdown stop working. I can see any value.

        function showSource(tab, multiPage, editor) { 
            editor.set_mode(2); 
            showEditorToolbar(true); 
            if (multiPage.get_selectedIndex() != 0) 
                multiPage.set_selectedIndex(0); 
     
            var oTool = getEditor().getToolByName("FontName"); //get a reference to the custom tool 
            oTool.setState(0); 
             
        } 

  9. Afroz khan
    Afroz khan avatar
    38 posts
    Member since:
    Dec 2009

    Posted 16 Jul 2014 in reply to Rumen Link to this post

    Hi Rumen,

    When i click on toggle button , editor allow to edit the content , could you please check what can be the better solution?
  10. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 18 Jul 2014 Link to this post

    Hi Afroz,

    The discussed matter in this thread is to enable the Print tool in the Preview mode.

    Due to that I can only assume how the toggle button (I assume the Toggle Full Screen Mode) is related to the RadEditor Edit modes and how the Rumen's suggestion is related to the full screen.

    When toggling the full screen it is expected the editor to be editable.

    Could you please provide more details about your concerns, so that I could better understand the encountered issue.

    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  11. Afroz khan
    Afroz khan avatar
    38 posts
    Member since:
    Dec 2009

    Posted 07 Aug 2014 in reply to Ianko Link to this post

    I have set the editor on preview mode becuase i dont want to allow editable to it , but to read the content i allow toggle mode but it allowing editing the content
  12. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 11 Aug 2014 Link to this post

    Hello Afroz,

    The described matter does not sound related to the forum thread to me.

    Due to that, I would like to ask you to open a proper support ticket to us and provide more details about your requirements and how the RadEditor control has been customized up to this point, so that we could properly investigate the described case and assist you on achieving the expected behavior.

    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017