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

Enable Print button in Preview Mode

3 Answers 147 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Vibes
Top achievements
Rank 1
Vibes asked on 25 Jun 2010, 01:06 PM
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

3 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 25 Jun 2010, 03:01 PM
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
0
Vibes
Top achievements
Rank 1
answered on 25 Jun 2010, 03:33 PM
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
0
Accepted
Dobromir
Telerik team
answered on 25 Jun 2010, 04:45 PM
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
Tags
Editor
Asked by
Vibes
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Vibes
Top achievements
Rank 1
Share this question
or