Menu
Context Menu
Context menus are menus that appear upon user interaction, typically a right-click, and display commands that apply to the object that was clicked.
Features
I have a Context Menu.
I have the same Context Menu.
You guessed it, me too.
Change Tax
Description
Context menus are menus that appear upon user interaction, typically a right-click, and display commands that apply to the object that was clicked.
We can set the context menu by setting owner property.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | using Microsoft.AspNetCore.Mvc; using System; using MvcExplorer.Models; namespace MvcExplorer.Controllers { public partial class MenuController : Controller { public ActionResult ContextMenu() { return View(); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | @ { var colors = new List< string > { "#f0a0a0" , "#a0f0a0" , "#a0a0f0" , "#0000ff" , "#ff0000" , "#ffff00" }; } @section Styles{ < style > .context { margin: 10px; padding: 20px; color: white; display: inline-block; } </ style > } @section Scripts{ <script> function setColor(arg) { wijmo.Control.getControl( "#ctxMenu" ).owner.style.background = arg; } </script> } < label > @Html .Raw(MenuRes.ContextMenu_Text0)</ label > < div class = "context" style = "background: #f0a0a0" > @Html .Raw(MenuRes.ContextMenu_Text1) </ div > < div class = "context" style = "background: #a0f0a0" > @Html .Raw(MenuRes.ContextMenu_Text2) </ div > < div class = "context" style = "background: #a0a0f0" > @Html .Raw(MenuRes.ContextMenu_Text3) </ div > < c1-menu header = "Change Tax" execute-command = "setColor" style = "display: none" id = "ctxMenu" owner = ".context" > < c1-menu-item header = "@MenuRes.ContextMenu_ColorPink" command-parameter = "colors[0]" ></ c1-menu-item > < c1-menu-item header = "@MenuRes.ContextMenu_ColorAqua" command-parameter = "colors[1]" ></ c1-menu-item > < c1-menu-item header = "@MenuRes.ContextMenu_ColorPurple" command-parameter = "colors[2]" ></ c1-menu-item > < c1-menu-item header = "@MenuRes.ContextMenu_ColorBlue" command-parameter = "colors[3]" ></ c1-menu-item > < c1-menu-item header = "@MenuRes.ContextMenu_ColorRed" command-parameter = "colors[4]" ></ c1-menu-item > < c1-menu-item header = "@MenuRes.ContextMenu_ColorYellow" command-parameter = "colors[5]" ></ c1-menu-item > </ c1-menu > @section Description{ @Html .Raw(MenuRes.ContextMenu_Text4) } |