Angular Diagram - viewToolbar.commands
Lists commands in the toolbar.
The view toolbar can contain default and custom commands. Handle the CustomCommand event to respond to a custom command click.
jQuery
$(function() {
var diagram = $("#diagram").dxDiagram({
viewToolbar: {
commands: ["zoomLevel", "fullScreen", "units", {name: "sayHello", text: "Say Hello", icon: "blockquote"},
{name: "export", icon: "export", items: ["exportSvg","exportPng","exportJpg"]}]
},
onCustomCommand: function(e) {
if (e.name == "sayHello")
alert("Hello!")
},
}).dxDiagram("instance");
});icon
Specifies the custom command's icon.
This property accepts one of the following:
- The icon's URL
- The icon's name if the icon is from the DevExtreme icon library
- The icon's CSS class if the icon is from an external icon library (see External Icon Libraries)
- The icon in the Base64 format
- The icon in the SVG format. Ensure that the source is reliable.
location
Specifies a location for the command or separator on the main toolbar.
Refer to the following section for more information: Specify a Command's Location on the Main Toolbar.
name
Specifies the custom command's identifier.
Use this name to identify the clicked custom command in the onCustomCommand function.