Removing a button and it's parent group

Last post 04-30-2013, 12:23 PM by Kenneth. 6 replies.
Sort Posts: Previous Next
  •  04-26-2013, 7:36 PM 77309

    Removing a button and it's parent group

    I have one page with one config file but under certain conditions I want to hide some buttons.

    (For example, in a modal vs standard window) 

     

    Here is the button in question. 

     

     

    It's fairly easy to add the button and then remove it later however the group that surrounds the lone button does not go away when it's empty. 

     

     This is what I am left with:

     

     

     Is there a way I can remove that empty group?

     

    Filed under: , ,
  •  04-26-2013, 9:02 PM 77310 in reply to 77309

    Re: Removing a button and it's parent group

    I'll also add the reverse of the question as that might be easier.

     

    If I were to remove the group and holder item from the config file could I programmatically add them in the C# code later? 

     

    Something like:

     

                    var groupStart = new ToolControl("", new System.Web.UI.LiteralControl("<table class='CuteEditorGroupMenu' cellSpacing='0' cellPadding='0' border='0' style='float: right;'><tr><td class='CuteEditorGroupMenuCell'><nobr>"));
                    var groupEnd = new ToolControl("", new System.Web.UI.LiteralControl("</nobr></td></tr></table>"));
                    var index = editor.ToolControls.IndexOf(name);

                    editor.ToolControls.Insert(index + 2, groupStart);
                    // Add control here @ 
                    editor.ToolControls.Insert(index + 4, groupEnd); 

     

    The problem above is the new tool controls aren't set up correctly so it's not working. 

  •  04-28-2013, 11:50 AM 77316 in reply to 77310

    Re: Removing a button and it's parent group

    Hi inserttemplate,

     

    Which Editor you are uisng? The CuteEditor 6.6? Or the RichTextEditor 8.0?

     

    Can you show me the config file code what you are using?

     

    Regards,

     

    Ken 

  •  04-29-2013, 1:40 PM 77327 in reply to 77316

    Re: Removing a button and it's parent group

    6.6 and up to date as of Thursday or Friday of last week.

     

    The config code for the button I want to add/remove is:


            <item type="g_start" />
            <item type="holder" name="FullScreen" />
            <item type="g_end" /> 

     

    The whole file is:

     *Removed*

  •  04-29-2013, 7:34 PM 77328 in reply to 77327

    Re: Removing a button and it's parent group

    Hi MasterShadow,

     

    The CuteEditor has not provide the method to remove the group, I suggest you create the different config file and switch the config file for each environment not just remove the button from the toolbar. It should be the same think as your requirement.

     

    Regards,

     

    Ken 

  •  04-29-2013, 8:35 PM 77331 in reply to 77328

    Re: Removing a button and it's parent group

    Is that feature available in the RichTextEditor 8.0?
  •  04-30-2013, 12:23 PM 77334 in reply to 77331

    Re: Removing a button and it's parent group

    Hi MasterShadow,

     

    The RichTextEditor 8.0 will not generate the empty group, so I think this will not be a problem in rte. 

     

    Regards,

     

    Ken 

View as RSS news feed in XML