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

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

1 Answer 197 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 28 Jan 2014, 07:22 AM
Hi there,

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

Regards,

Scott

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 28 Jan 2014, 01:36 PM
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!
Tags
Menu
Asked by
Scott
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or