Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146681 | Aug 13,2019 11:53 PM UTC | Jan 13,2020 05:05 AM UTC | Blazor | 3 |
![]() |
Tags: Menu Bar |
<EjsMenu Items="@menuItems">
<MenuEvents ItemSelected="onSelect"></MenuEvents>
</EjsMenu>
<div id="target">
<EjsDialog @ref="DialogObj" Target="#target" Height="270px" Width="500px" ShowCloseIcon="true" @bind-Visible="@Visibility">
..//
</EjsDialog>
</div>
@code{
EjsDialog DialogObj;
public bool Visibility { get;set; } = false;
private List<MenuItem> menuItems = new List<MenuItem>{
new MenuItem
{
Text = "File",
Items = new List<MenuItem>
{
new MenuItem { Text= "Open" },
new MenuItem { Text= "Navigate", Url="counter" }, // Url property, for navigating to counter page.
}
},
..//
};
private void onSelect(MenuEventArgs args)
{
if (args.Item.Text == "Open") // To check the selected item text
DialogObj.Show(); // To open the modal dialog.
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.