Log in to like this post! Optimize the UX of your applications with the Ignite UI jQuery Radial Menu Marina Stoyanova / Friday, May 23, 2014 The 14.1 release of Ignite UI came with a brand new OneNote MX Inspired jQuery Radial Menu control. This control presents its items in a circular arrangement around a center button and thus allows the end-user to select any item faster because each item is equally positioned in relation to the center. If you have been following my blogs so far you may have read the ones about the XAML Radial Menu and the WinForms Radial Menu. With the release of this Web UI widget now you can create office inspired apps on every platform. Essentials From User experience point of view the Radial Menu strikes 10 out of 10 points when it comes to easy navigation through the different items. With its circular structure every slice is equally distant from the center which means that you can reach/select every one of them for the same duration and considerably faster compared to using a normal menu. The supported item types for this control are various and has unlimited levels of hierarchy. Among those types you can find numerical values, color values as well as buttons that perform action. As I said this control is inspired by the OneNote MX menu which means that it is intended to be a tool for text editing but of course it is flexible so you can customize it and use it according to your needs. We are going to take a look at some of the basics to help you get started with this widget effortlessly. Let’s start by saying that by default the Radial Menu has 8 items – meaning that the inner area is separated in 8 equal slides and if you need less items the other space will remain blank. Of course that doesn’t mean that you are obligated to make 8 wedges, you just have to change the value of the minWedgeCount property to the number of items you need. This option comes in handy when you create a numericgauge item because it allows the gauge to spread along the whole inner area of the sub-item. If you want to create a numeric item you have to add an item of numericitem type which will act as a button to the numeric gauge. Visually the slice will contain a custom image or header if any and an associated numeric value above them. The child item should be of numericgauge type which will allow to select a numeric value. JS: $("#radialMenu").igRadialMenu({ width: "300px", height: "300px", minWedgeCount: 1, items: [ { type: "numericitem", header: "Font Size", iconUri: "/Icons/Size.png", value: "8", items: [ { name: "gauge1", type: "numericgauge", ticks: "10,12,18,24,36", value: 12, smallIncrement: 2, valueChanged: function (evt, ui) { if (evt.newValue == 10) setFontSize(2); else if (evt.newValue == 12) setFontSize(3); else if (evt.newValue == 18) setFontSize(5); else if (evt.newValue == 24) setFontSize(6); else if (evt.newValue == 36) setFontSize(7); } } ] } ] }); MVC: @( Html.Infragistics().RadialMenu() .ID("radialMenu") .Width("300px") .Height("300px") .MinWedgeCount(1) .Items(i => { i.NumericItem("numItems1") .Header("Size") .IconUri("/Icons/Size.png") .Value(8) .Items(subItem => subItem.NumericGauge("numGauge1") .WedgeSpan(5) .Ticks(new double[] {8,9,10,11,12,13,14,16,18,20,22,24,26,28,36,48}) .Value(8)); }) .Render() ) Image: Another specific item type is the coloritem. When you add this item to the menu it will display custom image and header if any and an associated color. The child items should be of colorwell type. This item is specialized item that displays associated color in the item area and the outer ring. To create the whole palette of colors you need to add a hierarchy of color well children. The snippet below demonstrates how to do that for the yellow color. JS: type: "coloritem", header: "Foreground", iconUri: "/Icons/FColor.png", items: [ { type: "colorwell", color: "#FFFF00", autoRotateChildren: false, items: [ { type: "colorwell", color: "#ffffe5" }, { type: "colorwell", color: "#ffffcc" }, { type: "colorwell", color: "#ffffb9" }, { type: "colorwell", color: "#ffff99" }, { type: "colorwell", color: "#ffff7f" }, { type: "colorwell", color: "#ffff66" }, { type: "colorwell", color: "#ffff4c" }, { type: "colorwell", color: "#ffff32" }, { type: "colorwell", color: "#ffff19" } ] },{...} ] MVC: i.ColorItem("colorItem1") .Header("Color") .IconUri("/Icons/BColor.png") .Items(si => { si.ColorWell().Color("#FFFF00").Items(colorItem => { colorItem.ColorWell().Color("#FFD55F"); colorItem.ColorWell().Color("#FFEB9C"); colorItem.ColorWell().Color("#FFFF00"); colorItem.ColorWell().Color("#AC4D25"); colorItem.ColorWell().Color("#D16227"); colorItem.ColorWell().Color("#EB7C23"); colorItem.ColorWell().Color("#F6901E"); colorItem.ColorWell().Color("#FFC000"); }); }); Image: You can see from the images that in the outer ring above some of the items there are arrows – this is an indicator that these items have sub-items and you can navigate to them through those arrows. All items ( regardless if they have child items or not) act as simple buttons you can assign actions to through the click handler . For the items with hierarchical structure, each time a child item is used, its name is set on the parent's recentItem property. You can use that property to perform the same functionality the child item had from the parent, essentially functioning the same way as a split button would. JS: $("#radialMenu").igRadialMenu({ width: "300px", height: "300px", minWedgeCount: 1, items: [ { name: "bold", header: "Bold", iconUri: "/Icons/Bold.png", click: function () { toggleBold(); } } ] }); MVC: @( Html.Infragistics().RadialMenu() .ID("radialMenu") .Width("300px") .Height("300px") .MinWedgeCount(1) .Items(i => { i.Item("button1") .Header("Bold") .IconUri("/Icons/Bold.png") .ClientEvents(new Dictionary<string, string>() { { "click", "function(evt, ui) { alert('Bold clicked'); }" } }); }) .Render() ) Image: The following snippet is an example how to make a parent item act like a split button. type: "list", header: "Font", highlightBrush: "#004A7F", outerRingButtonFill: "#4C4C4C", outerRingButtonHotTrackFill: "#66CCFF", autoRotateChildren: false, iconUri: "/Icons/Font.png", click: function (evt, ui) { setFontFamily(evt.item.recentItemName); }, items: [ { header: "Arial", name: "Arial", highlightBrush: "#004A7F", click: function (evt, ui) { setFontFamily(evt.item.name); } }, { header: "Calibri", name: "Calibri", highlightBrush: "#004A7F", click: function (evt, ui) { setFontFamily(evt.item.name); } }, { header: "Comic Sans", name: "Comic Sans MS", highlightBrush: "#004A7F", click: function (evt, ui) { setFontFamily(evt.item.name); } }, { header: "Consolas", name: "Consolas", highlightBrush: "#004A7F", click: function (evt, ui) { setFontFamily(evt.item.name); } }, { header: "Courier New", name: "Courier New", highlightBrush: "#004A7F", click: function (evt, ui) { setFontFamily(evt.item.name); } }, { header: "Segoe", name: "Segoe UI", highlightBrush: "#004A7F", click: function (evt, ui) { setFontFamily(evt.item.name); } }, { header: "Tahoma", name: "Tahoma", highlightBrush: "#004A7F", click: function (evt, ui) { setFontFamily(evt.item.name); } }, { header: "Times", name: "Times New Roman", highlightBrush: "#004A7F", click: function (evt, ui) { setFontFamily(evt.item.name); } }, { header: "Verdana", name: "Verdana", highlightBrush: "#004A7F", click: function (evt, ui) { setFontFamily(evt.item.name); } } ] } Let’s get creative The radial menu can be separated in three main parts – outer ring, inner area and center button. All of these parts can be easily customized by changing their brush, highlights, border and etc.. Let’s go over the options that are related to these parts and see how to manipulate and change the appearance of the control. We are going to stat from inside out. The center button! The center button is the first thing you see when you run the control. Thanks to it you can expand or collapse the Radial Menu as well as navigate through the hierarchical levels of the different options (it allows access to menu items on the previous level). It has three main states: closed, open and when you interact with it. Each of there states is connected with two options one for the border stroke and one responsible for the internal fill color. Let’s continue with the inner area. The inner area displays the current level menu items. Similar to the center button this part of the menu has states, which means that you can change the appearance of the inner area when it is in a undisturbed condition and then you interact with one of the items. The outer edge of this inner area is called a selection arc and in this arc you can see the currently hovered menu item highlights and its checked state. The outer part of the radial menu is the Outer Ring. If there are arrows above the items in this part of the menu this means that these items have sub-items and you can navigate to them. As you have probably guessed similar to the above mentioned parts of the control you can manipulate the outer ring on few levels. You can change the appearance of the main ring as well as the appearance of the buttons on it. The supported option for customizing this ring are various and detailed. You can even customize the arrow on the the buttons. Summary The main idea behind the radial menu is to be simple and easy to work with. It should present small number of items and distribute them in a circular arrangement which speeds up items selection. It is designed to look and behave like OneNote’s radial menu but it allows you to customize it and adopt it to your needs. This colorful, functional and handy widget can undoubtedly optimize the user experience of your applications. Check out a live demo on jsFiddle or download the ASP.NET MVC sample. You can follow us on Twitter @Infragistics and stay in touch on Facebook, Google+ and LinkedIn!