You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/menu/events.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ This article explains the events available in the Telerik Menu for Blazor:
16
16
17
17
## OnSelect
18
18
19
-
The `OnSelect` event fires when the user clicks or taps on a menu item. It receives the model of the item as an argument that you can cast to the concrete type you are using.
19
+
The `OnSelect` event fires when the user clicks or taps on a menu item. It receives the model of the item as an argument that you can cast to the concrete model type you are using.
20
20
21
21
You can use the `OnSelect` event to react to user choices in a menu without using navigation to load new content automatically.
22
22
@@ -25,17 +25,17 @@ You can use the `OnSelect` event to react to user choices in a menu without usin
Copy file name to clipboardExpand all lines: components/menu/templates.md
+18-21Lines changed: 18 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,32 +14,31 @@ The Menu component allows you to define a custom template for its items. This ar
14
14
15
15
The `ItemTemplate` of an item is defined under the `ItemTemplate` tag of the menu.
16
16
17
-
The template receives the model to which the item is bound as its `context`. You can use it to render the desired content.
17
+
The template receives the model to which the item is bound as its `context`. You can use it to render the desired content. The menu is a generic component, so you can use a named context variable that will be of the model type without additional casting.
18
18
19
19
You can use the template to render arbitrary content according to your application's data and logic. You can use components in it and thus provide rich content instead of plain text. You can also use it to add DOM event handlers like click, doubleclick, mouseover if you need to respond to them.
20
20
21
-
>caption Use templates to implement navigation between views without the usage of the UrlField feature
21
+
>caption Use templates to implement navigation between views without the UrlField feature
22
22
23
23
````CSHTML
24
24
@using Telerik.Blazor.Components.Menu
25
25
26
-
<TelerikMenu Data="@MenuItems"
27
-
ItemsField="@nameof(MenuItem.SubSectionList)">
28
-
<ItemTemplate>
29
-
@{
30
-
var item = context as MenuItem;
31
-
var shouldNavigate = !string.IsNullOrEmpty(item.Page);
0 commit comments