Is there a simple or generic way to remove all menu items?

2 posts, 0 answers
  1. Scott
    Scott avatar
    5 posts
    Member since:
    Jun 2013

    Posted 28 Jan 2014 Link to this post

    Hi there,

    Is there a simple or generic way to remove all menu items?

    Regards,

    Scott
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 28 Jan 2014 Link to this post

    Hi Scott,


    To remove a menu item you should use the remove method of the API, which accepts a selector for the item to be removed. A short way to remove all menu items would be the following.
    E.g.
    var menu = $("#menu").data("kendoMenu");
    $("#menu>li").each(function(){
       menu.remove(this);
    });

    I hope this information helps.

    Regards,
    Dimiter Madjarov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
Back to Top