Cannot remove menuButtons of splitButton

3 posts, 0 answers
  1. Jack
    Jack avatar
    100 posts
    Member since:
    Jan 2007

    Posted 08 Dec 2014 Link to this post

    See http://dojo.telerik.com/AjEla
    Note being able to disable and remove subitems makes the ToolBar almost useless to me.
  2. Jack
    Jack avatar
    100 posts
    Member since:
    Jan 2007

    Posted 08 Dec 2014 Link to this post

    Please validate the following workaround (memory leaks):
    $("#user-toolbar-view-profile").off()
        .closest('li').off().remove();
  3. Kendo UI is VS 2017 Ready
  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 10 Dec 2014 Link to this post

    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!
     
Back to Top