This is a migrated thread and some comments may be shown as answers.
Loop through all child items
1 Answer 73 Views
This is a migrated thread and some comments may be shown as answers.
Gabriel
Top achievements
Rank 1
Gabriel asked on 16 Jan 2012, 05:05 AM

How would I go about looping through the entire items in a menu but only get the items from the last nested list? Say I have the following menu:

  • Animals
    • cat
    • dog
    • parrot
  • Food
    • Drinks
      • water
      • Pepsi
      • booze
    • Fruit
      • apple
      • pear
      • carrot

The items in bold is what I mean - the end of the line so to speak in each root item.

1 Answer, 1 is accepted

Sort by
0
Accepted
Kamen Bundev
Telerik team
answered on 18 Jan 2012, 01:53 PM
Hello Gabriel,

This can be done with a single jQuery selector, something like this:
$("#Menu").find(".k-item:not(:has(.k-group))");

Regards,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Menu
Asked by
Gabriel
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Share this question
or