Enable ToolBar Button in preview mode

11 posts, 0 answers
  1. Vincent
    Vincent avatar
    70 posts
    Member since:
    Jul 2008

    Posted 21 Mar 2010 Link to this post

    Hi

    I just encounter the same problem (refer to http://www.telerik.com/community/forums/aspnet-ajax/editor/enable-toolbar-button-in-preview-mode.aspx). When I change my editor to html view, I want to enable the "FontName", it seems dropdown stop working. I can't 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); 
             
        } 

    BTW: It works under IE, but not firefox
  2. Rumen
    Admin
    Rumen avatar
    14459 posts

    Posted 22 Mar 2010 Link to this post

    Hello Vincent,

    RadEditor does not offer support for the requested feature out-of-the box and we do not support it.

    The RadEditor commands are designed to be executed in Design mode only. Yes, you can enable the buttons icons using the setState method but this will not enable the Cut, Copy, Paste, Undo and Redo commands because the content area in Html mode is a textbox but the content area in Design mode is editable IFRAME.

    You can get a reference to the textbox in HTML mode using the editor.get_textArea() method and implement your own buttons and commands by enabling them when switching to HTML mode.

    Kind regards,
    Rumen
    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. Vincent
    Vincent avatar
    70 posts
    Member since:
    Jul 2008

    Posted 22 Mar 2010 Link to this post

    Hi Rumen

    First, thanks for your answer. But it seems you misunderstand my question.

    I had a custom dropdown setup in my code behind when page load, and when I switch to html mode and change the state to enable my custom dropdown, it works under IE and I can see all values bound to this dropdown, but it's not working in Firefox. Please see the attachment.

            void initProfileFieldsDropdown() 
            { 
                EditorToolGroup dynamicToolbar = ed.Tools[0]; 
     
                //add a custom dropdown and set its items and dimension attributes 
                EditorDropDown ddn = new EditorDropDown("MergeFields"); 
                ddn.Text = "Merge Fields"
     
                //Set the popup width and height 
                ddn.Attributes["width"] = "255px"
                ddn.Attributes["popupwidth"] = "255px"
                ddn.Attributes["popupheight"] = "100px"
     
                int defaultListId = int.Parse(SmartmailAccountManager.GetAccountDetails(User.AccountId)["DefaultListId"].ToString()); 
                DataTable fields = ProfilesManager.GetProfileFields(defaultListId); 
     
                foreach (DataRow row in fields.Rows) 
                { 
                    string columName = row["ColumnName"].ToString(); 
     
                    ddn.Items.Add(columName, string.Format("{{merge:{{field:{0}}}}}", columName)); 
                } 
     
                //Add tool to toolbar 
                dynamicToolbar.Tools.Insert(0, ddn); 
       
            } 

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

    Posted 24 Mar 2010 Link to this post

    Hi

    Can you give some solution? it seems radeditor bug.
  5. Rumen
    Admin
    Rumen avatar
    14459 posts

    Posted 25 Mar 2010 Link to this post

    Hello Vincent,

    I was able to reproduce the problem and logged it for implementation in our PITS system.

    I would like to note once again that the requested feature is not part of the advertised functionality provided by the control. This is not a bug, but a feature request that we plan to provide in the future.

    I updated your Telerik points for sharing your scenario and your feature request.

    Sincerely yours,
    Rumen
    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.
  6. IT Manager
    IT Manager avatar
    7 posts
    Member since:
    Sep 2007

    Posted 11 Jan 2012 Link to this post

    Hi Rumen,
    This is an old issue but we came across it again recently. Do you know if the feature has been done?

    Regards,
    Joanna
  7. Richard
    Richard avatar
    479 posts
    Member since:
    Nov 2011

    Posted 12 Jan 2012 Link to this post

    Joanna:

    Can you provide more insights on the problem that you're facing here? Are you trying to enable a toolbar button in preview mode, as per the title thread? Or, are you facing issues that are browser specific?

    Cheers!
  8. IT Manager
    IT Manager avatar
    7 posts
    Member since:
    Sep 2007

    Posted 12 Jan 2012 Link to this post

    Hi,

    Issue now is inconsistency in behaviour. We have a custom button which is a drop down list similar to Font Name but will insert the selected text. On switch to HTML editor, the toolbar is disabled so this drop down should not work. That is the behaviour for Chrome, FF and IE 9 but not on IE 8. On IE 8, the button worked as if on Design mode.

    Earlier, we tried to set the state to enabled but it only worked for IE and not FF. See comment by Vincent. Rumen said that this will be raised as a feature request. Was the feature already developed? If so, we will enable this button for both Design and HTML editors and hopefully behaviour is the same for all browsers.

    Regards,
    Joanna

  9. Rumen
    Admin
    Rumen avatar
    14459 posts

    Posted 13 Jan 2012 Link to this post

    Hi Joanna,

    After detailed research and testing, this feature was not implemented because of the multiple side effects that occur under different browsers. If our developers, find a solution in future, we will definitely post a note in this forum thread.

    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  10. IT Manager
    IT Manager avatar
    7 posts
    Member since:
    Sep 2007

    Posted 15 Jan 2012 Link to this post

    Thanks, Rumen. That's fine. We'll simply wait for the feature.

    Regarding the button working only on IE 8, do you have any suggestion on what we can do? Our clients are thinking that the correct behaviour is on IE 8 when truth is, the button is only worked there by mistake.

    Regards,
    Joanna
  11. Rumen
    Admin
    Rumen avatar
    14459 posts

    Posted 18 Jan 2012 Link to this post

    Hello,

    I am not sure why your custom button is enabled in HTML mode in IE8 and I was unable to reproduce this behavior in the live demos: Custom Tools and Custom Dropdowns. Please, test these demos and let me know if you are able to reproduce the IE8 problem.

    If you unable to find the reason for the problem, could you please isolate it in a sample working project and send it for examination via a support ticket?

    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top