How to determine whether a menu item has children items?

3 posts, 1 answers
  1. Yingyi
    Yingyi avatar
    5 posts
    Member since:
    Aug 2010

    Posted 07 Aug 2013 Link to this post

    I need to determine whether an item has children or not.
    Any easy way to do it?

    Thanks.

    Yingyi
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8332 posts

    Posted 09 Aug 2013 Link to this post

    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!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Yingyi
    Yingyi avatar
    5 posts
    Member since:
    Aug 2010

    Posted 09 Aug 2013 Link to this post

    Thanks.  It works!
Back to Top