Skip to content

Commit dd8702c

Browse files
docs(menu): update HasChildren behavior
1 parent 231956c commit dd8702c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

_contentTemplates/menu/basic-example.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
Before continuing, make sure you are familiar with the [menu data binding basics]({%slug components/menu/data-binding/overview%}).
33
#end
44

5+
#has-children-behavior-flat-data
6+
for items that have children, you must set it to `true`. If you set it to `false`, child items will not be rendered even if they are present in the data. If there are no child items in the data, an expand icon will not be rendered regardless of its value.
7+
#end

components/menu/data-binding/flat-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Flat data means that the entire collection of menu items is available at one lev
1818

1919
The parent-child relationships are created through internal data in the model - the `ParentId` field which points to the `Id` of the item that will contain the current item. The root level has `null` for `ParentId`.
2020

21-
You must also provide the correct value for the `HasChildren` field - for items that have children, you must set it to `true` so that the expand arrow is rendered.
21+
You must also provide the correct value for the `HasChildren` field - @[template](/_contentTemplates/menu/basic-example.md#has-children-behavior-flat-data)
2222

2323
>caption Example of flat data in a menu (for brevity, URLs are omitted)
2424

components/menu/data-binding/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ First, review:
1919

2020
There are two modes of providing data to a menu, and they all use the items' features. Once you are familiar with the current article, choose the data binding more you wish to use:
2121

22-
* [Flat data]({%slug components/menu/data-binding/flat-data%}) - a single collection of items with defined parent-child relationships.
2322
* [Hierarchical data]({%slug components/menu/data-binding/hierarchical-data%}) - separate collections of items and their child items.
23+
* [Flat data]({%slug components/menu/data-binding/flat-data%}) - a single collection of items with defined parent-child relationships.
2424

2525
## Menu Item Features
2626

2727
The menu items provide the following features that you control through the corresponding fields in their data binding:
2828

2929
* `Id` - a unique identifier for the item. Required for binding to flat data.
3030
* `ParentId` - identifies the parent to whom the item belongs. Required only when binding to flat data. All items with the same `ParentId` will be rendered at the same level. For a root level item, this must be `null`.
31-
* `HasChildren` - whether the item has children. Determines whether an expand arrow is rendered next to the item. Required for binding to flat data. With hierarchical data, the menu will render the icon based on the existence of child items, but `HasChildren` will take precedence.
31+
* `HasChildren` - whether the item has child items. Required for binding to flat data - @[template](/_contentTemplates/menu/basic-example.md#has-children-behavior-flat-data) With hierarchical data, the menu will render the icon based on the existence of child items, but `HasChildren` will take precedence.
3232
* `Items` - the collection of child items that will be rendered under the current item. Required only when binding to hierarchical data.
3333
* `Text` - the text that will be shown on the item.
3434
* `Icon` / `IconClass` / `ImageUrl` - the [Telerik icon]({%slug general-information/font-icons%}), a class for a custom font icon, or the URL to a raster image that will be rendered in the item. They have the listed order of precedence in case more than one is present in the data (that is, an `Icon` will have the highest importance).

0 commit comments

Comments
 (0)