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

How to determine whether a menu item has children items?

2 Answers 151 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Yingyi
Top achievements
Rank 1
Yingyi asked on 07 Aug 2013, 02:35 PM
I need to determine whether an item has children or not.
Any easy way to do it?

Thanks.

Yingyi

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 09 Aug 2013, 12:26 PM
Hi Yingyi,

You can use the following check:

var menuItem;
// menuItem is a Menu item <li> jQuery object
var hasChildren = menuItem.find(".k-group").length > 0;


Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Yingyi
Top achievements
Rank 1
answered on 09 Aug 2013, 03:00 PM
Thanks.  It works!
Tags
Menu
Asked by
Yingyi
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Yingyi
Top achievements
Rank 1
Share this question
or