Share via


Shell.UI.Commands.js

 

Applies To: Windows Azure Pack

Provides methods to create, modify, or remove command buttons from the drawer. Each command can contain sub-commands.

Widgets

None.

Types

Shell.UI.Commands.Command(text, icon, click, group, disabled)

Name

Description

text

The display text of the button.

icon

A Shell.UI.Icons code or the URL of the icon.

click

The callback to associate with the click event.

group

The group, global or contextual.

disabled

Indicates whether the command is enabled.

Properties

None.

Methods

Name

Description

Returns

Parameters

Shell.UI.Commands.addCommand

Adds one or more commands to the framework.

Nothing

command (Shell.UI.Commands.Command): Command or array of commands.

Shell.UI.Commands.Command.addSubCommand

Adds a subcommand. Returns the added sub-command.

subCommand

index (Number): Index of the step, if not provided, adds at the end.

text (String): Text of the SubCommand.

click (Function): Click callback of the SubCommand.

disabled (Boolean): Disabled status of the SubCommand. Defaults to false.

syncLater (Boolean): INTERNAL. Sync Later, used for multiple commands to add.

Shell.UI.Commands.Command.addSubCommands

Adds subcommands. Returns an array of the added sub-commands.

Array of subCommands

index (Number): Index of the step, if not provided, adds at the end.

subCommands (Array): SubCommands. Array of objects containing the following keys: text, click, disabled

Shell.UI.Commands.clearCommands

Clears all the commands from the specific group in the framework. If no group is provided, clear from all the groups.

Nothing

group (String): Group.

Shell.UI.Commands.removeCommand

Removes one or more commands to the framework.

Nothing

command (Shell.UI.Commands.Command): Command.

Shell.UI.Commands.Command.removeSubCommand

Removes a subCommand.

Nothing

subCommand (Shell.UI.Comamnds.SubCommand): The subCommand.

syncLater (Boolean): Sync Later, used to remove multiple commands.

Shell.UI.Commands.Command.removeSubCommands

Removes subCommands.

Nothing

subCommands (Array): The subCommands.

Shell.UI.Commands.Command.setClick

Sets the click callback.

Nothing

click (Function): The callback.

Shell.UI.Commands.Command.setDisabled

Sets the disabled state.

Nothing

disabled (Boolean): The disabled state.

Shell.UI.Commands.Command.setIcon

Sets the icon.

Nothing

icon (Object): URL string of the icon or a Shell.UI.Icons code.

Shell.UI.Commands.Command.setText

Sets the text.

Nothing

text (String): The text.

Shell.UI.Commands.Command.sync

Syncs the command.

Nothing

None

Shell.UI.Commands.Command.toJSON

Converts to JSON.

widgetOptions

a: First Parameter.

b: Second Parameter.

c: Third Parameter.

See Also

Windows Azure Pack Extension Shell Library Reference