Enable Print button in Preview Mode

4 posts, 1 answers
  1. Vibes
    Vibes avatar
    3 posts
    Member since:
    Jun 2010

    Posted 25 Jun 2010 Link to this post

    Hi,

    I am a new user to RadControls so pardon my ignorance.

    What we essentially want is that:
    1. A user is shown the contents in the editor
    2. He should not be allowed to change it.
    3. He should be allowed to print the contents of the editor.

    If I switch to preview mode, the buttons gets disabled. I there a way I can achieve the above?

    Regards,
    Vaibhav
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 25 Jun 2010 Link to this post

    Hi Vaibhav,

    Please take a look at the following forum thread. There you can find the solution how to achieve the required functionality:
    Enable ToolBar Button in preview mode

    Greetings,
    Dobromir
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Vibes
    Vibes avatar
    3 posts
    Member since:
    Jun 2010

    Posted 25 Jun 2010 Link to this post

    Hi Dobromir,

    Thanks for the help. The solution works fine.
    Though I am a little confused with a small thing. Why do we need to call the setTimeout method in the javascript code?

            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
                } 
            }  

    Regards,
    Vaibhav
  4. Answer
    Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 25 Jun 2010 Link to this post

    Hi Vaibhav,

    The setTimeout in this handler is used to ensure that the custom code will be executed after the default RadEditor's scripts that disable the tools.

    Sincerely yours,
    Dobromir
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top