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

Enable ToolBar Button in preview mode

10 Answers 96 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Vincent asked on 22 Mar 2010, 03:40 AM
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

10 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 22 Mar 2010, 01:30 PM
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.
0
Vincent
Top achievements
Rank 1
answered on 22 Mar 2010, 10:36 PM
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); 
   
        } 

0
Vincent
Top achievements
Rank 1
answered on 25 Mar 2010, 04:23 AM
Hi

Can you give some solution? it seems radeditor bug.
0
Rumen
Telerik team
answered on 25 Mar 2010, 04:51 PM
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.
0
IT Manager
Top achievements
Rank 1
answered on 12 Jan 2012, 03:01 AM
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
0
Richard
Top achievements
Rank 1
answered on 12 Jan 2012, 06:36 PM
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!
0
IT Manager
Top achievements
Rank 1
answered on 12 Jan 2012, 11:17 PM
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

0
Rumen
Telerik team
answered on 13 Jan 2012, 03:17 PM
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
0
IT Manager
Top achievements
Rank 1
answered on 15 Jan 2012, 08:28 PM
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
0
Rumen
Telerik team
answered on 18 Jan 2012, 01:24 PM
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
Tags
Editor
Asked by
Vincent
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Vincent
Top achievements
Rank 1
IT Manager
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Share this question
or