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

Cannot remove menuButtons of splitButton

2 Answers 118 Views
Toolbar
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 2
Iron
Jack asked on 08 Dec 2014, 05:44 PM
See http://dojo.telerik.com/AjEla
Note being able to disable and remove subitems makes the ToolBar almost useless to me.

2 Answers, 1 is accepted

Sort by
0
Jack
Top achievements
Rank 2
Iron
answered on 08 Dec 2014, 06:10 PM
Please validate the following workaround (memory leaks):
$("#user-toolbar-view-profile").off()
    .closest('li').off().remove();
0
Alexander Valchev
Telerik team
answered on 10 Dec 2014, 11:00 AM
Hello Jack,

The remove method of the widget is intended to be used only for removing the top level tools. It will not work for removing menu button of a SplitButton.

Your workaround is valid but you should also remove the corresponding button from the overflow popup as well (unless you have resizable: false). Elements located in the overflow popup receive the same ID but with "_overflow" suffix. In addition there is no need to call the off method. There are no events attached to the menu button element itself, events are attached at higher DOM level. You may simply call the remove method for the parent "li" element, the jQuery remove method will also clear the jQuery data associated with the elements.

We will also discuss the idea for introducing API for removing SplitButton sub items.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Toolbar
Asked by
Jack
Top achievements
Rank 2
Iron
Answers by
Jack
Top achievements
Rank 2
Iron
Alexander Valchev
Telerik team
Share this question
or