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

Preview mode

7 Answers 146 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 20 Jul 2010, 05:55 PM
I have 2 editors. The first has Design and Preview modes enabled. When I switch from Design to Preview mode the toolbars are disabled. This is a good thing.

On the other editor, I only have Preview mode enabled and the toolbars here are enabled. Why is this different from the other editor?

-- 
Stuart

7 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 23 Jul 2010, 11:46 AM
Hi Stuart,

We are not aware of such problem and you are the first one to report it. I tried to reproduce the problem on my side but to no avail.

Could you please open a support ticket and provide a sample project reproducing the problem so we can investigate it further?

On a side note, is any JavaScript error thrown on the page during load? If so, this might interrupt of the further execution of the JavaScript code related to the disabling of the toolbar of the second editor.

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
Stuart Hemming
Top achievements
Rank 2
answered on 23 Jul 2010, 12:30 PM
Dobromir ,

Sorry, my bad. I neglected to mention something; the editors are in RadPageView controls.

Below is a standalone page that demonstrates the problem...
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
  <head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1"
                                  runat="server"/>
  </head>
  <body>
    <form id="form1"
          runat="server">
      <telerik:RadScriptManager ID="RadScriptManager1"
                                runat="server">
        <Scripts>
          <%--Needed for JavaScript IntelliSense in VS2010--%>
          <%--For VS2008 replace RadScriptManager with ScriptManager--%>
          <asp:ScriptReference Assembly="Telerik.Web.UI"
                               Name="Telerik.Web.UI.Common.Core.js"/>
          <asp:ScriptReference Assembly="Telerik.Web.UI"
                               Name="Telerik.Web.UI.Common.jQuery.js"/>
          <asp:ScriptReference Assembly="Telerik.Web.UI"
                               Name="Telerik.Web.UI.Common.jQueryInclude.js"/>
        </Scripts>
      </telerik:RadScriptManager>
      <script type="text/javascript">
        //Put your JavaScript code here.
      </script>
      <telerik:RadAjaxManager ID="RadAjaxManager1"
                              runat="server">
      </telerik:RadAjaxManager>
  
      <telerik:RadSkinManager ID="RadSkinManager1"
                              Runat="server"
                              Skin="WebBlue">
      </telerik:RadSkinManager>
      <telerik:RadTabStrip ID="RadTabStrip1"
                           runat="server"
                           MultiPageID="RadMultiPage1"
                           SelectedIndex="0">
        <Tabs>
          <telerik:RadTab Value="edit"
                          Text="Edit"/>
          <telerik:RadTab Value="history"
                          Text="History"/>
        </Tabs>
      </telerik:RadTabStrip>
      <telerik:RadMultiPage ID="RadMultiPage1"
                            runat="server"
                            SelectedIndex="0">
        <telerik:RadPageView ID="RadPageView1"
                             runat="server">
          <telerik:RadEditor ID="edtNote"
                             runat="server"
                             EnableResize="false"
                             EnableViewState="true"
                             ContentAreaMode="Div"
                             EditModes="Design, Preview"
                             NewLineBr="false"
                             ToolbarMode="Default">
            <Modules>
              <telerik:EditorModule Name="RadEditorStatistics"
                                    Enabled="false"
                                    Visible="false"/>
              <telerik:EditorModule Name="RadEditorDomInspector"
                                    Enabled="false"
                                    Visible="false"/>
              <telerik:EditorModule Name="RadEditorHtmlInspector"
                                    Enabled="false"
                                    Visible="false"/>
              <telerik:EditorModule Name="RadEditorNodeInspector"
                                    Enabled="false"
                                    Visible="false"/>
            </Modules>
          </telerik:RadEditor>
        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView2"
                             runat="server">
          <telerik:RadEditor ID="edtHistory"
                             runat="server"
                             EnableResize="false"
                             ContentAreaMode="Div"
                             EditModes="Preview"
                             NewLineBr="false">
            <CssFiles>
              <telerik:EditorCssFile Value="~/App_Themes/Default/Default.css"/>
            </CssFiles>
            <Modules>
              <telerik:EditorModule Name="RadEditorStatistics"
                                    Enabled="false"
                                    Visible="false"/>
              <telerik:EditorModule Name="RadEditorDomInspector"
                                    Enabled="false"
                                    Visible="false"/>
              <telerik:EditorModule Name="RadEditorHtmlInspector"
                                    Enabled="false"
                                    Visible="false"/>
              <telerik:EditorModule Name="RadEditorNodeInspector"
                                    Enabled="false"
                                    Visible="false"/>
            </Modules>
          </telerik:RadEditor>
        </telerik:RadPageView>
      </telerik:RadMultiPage>
    </form>
  </body>
</html>

For the sake of completion, I've included 3 screen shots; ss1 shows the fist editor in Design mode, ss2 the same editor in Preview mode and the ss3 the 2nd editor in Preview mode.

-- 
Stuart
0
Stuart Hemming
Top achievements
Rank 2
answered on 23 Jul 2010, 12:35 PM
Dobromir,

I forgot to mention that there is no evidence of any JS errors when the page executes.

-- 
Stuart
0
Stuart Hemming
Top achievements
Rank 2
answered on 23 Jul 2010, 12:44 PM
Hmmm. This is interesting...

If I edit the markup so the the "History" tab is initially selected the toolbars on the editor are correctly disabled.

-- 
Stuart
0
Stuart Hemming
Top achievements
Rank 2
answered on 27 Jul 2010, 08:24 AM
Any thoughts?

-- 
Stuart
0
Accepted
Dobromir
Telerik team
answered on 27 Jul 2010, 02:11 PM
Hi Stuart,

Thank you for the additional information and the sample page. This problem occurs when the RadEditor is placed in initially invisible parent. You can use the following approach to avoid this issue:
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
    SelectedIndex="0" OnClientTabSelected="OnClientTabSelected">
    <Tabs>
        <telerik:RadTab Value="edit" Text="Edit" />
        <telerik:RadTab Value="history" Text="History" />
    </Tabs>
</telerik:RadTabStrip>
 
...........
...........
 
<script type="text/javascript">
    function OnClientTabSelected(sender, args)
    {
        if (args.get_tab().get_index() == "1")//check if the selected tab is the one containing the correct editor
        {
            setTimeout(function ()
            {
                var editor = $find("<%= edtHistory.ClientID %>");//get reference to the editor
                editor.set_editable(false);
                editor.enableEditing(false);
            }, 0);
        }
    }
</script>


Best wishes,
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
Stuart Hemming
Top achievements
Rank 2
answered on 29 Jul 2010, 08:07 PM
Dobromir,

Thanks for the explanation and the workaround.

I'll be adding this to my code soonest.

-- 
Stuart
Tags
Editor
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Dobromir
Telerik team
Stuart Hemming
Top achievements
Rank 2
Share this question
or