Table Of Contents

Application Packaging Standard

Last updated 18-Mar-2019

aps/ToolsItem

Widget in the form of a tile with a title, description, and icon.

This widget should be used ONLY inside an aps/ToolsList.

Overview

Using the aps/ToolsItem widget, you can display a link of a special kind presenting a certain tool for users.

You can set the widget in such a way, that when clicking a button it changes its color to grey, text on the button also changes, and the button itself becomes disabled until the cancel method is called for the button.

The autobusy, busyLabel, and timeout properties affect such behavior as described in the Public Properties section.

Example

RUN DEMO

require(["aps/load", "aps/ready!"],
    function(load) {
        "use strict";
        load([ "aps/ToolsList",
            { title: "Maintaince" },
            [[ "aps/ToolsItem",
                {
                    title: 		"SiteBuilder",
                    iconName: 	"/aps/ppanel-theme/icons/32/plesk/sitebuilder.png"
                }
            ], [ "aps/ToolsItem",
                {
                    title: 		"Applications",
                    iconName: 	"/aps/ppanel-theme/icons/32/plesk/site-aps.png"
                }
            ], [ "aps/ToolsItem",
                {
                    title: 		"Web Statistics",
                    iconName: 	"/aps/ppanel-theme/icons/32/plesk/web-stats.png"
                }
            ]]
        ]);
});

Public Properties

PROPERTY TYPE DEFAULT DESCRIPTION
autoBusy boolean false If true then a button will be disabled after a click.
busyLabel string “Please wait” text displayed while a button is busy.
description string “” Text under the header of the widget.
disabled boolean false Specifies if the widget will respond to user input.
gridSize string undefined This specifies the widget width that is relevant only for widgets inside Container, FieldSet, or Tiles.
iconName string “” Address to the icon.
isBusy boolean false If a button is disabled then this property is true.
label string “” Text that is shown as a label if the widget is placed inside a aps/FieldSet.
timeout number 0 If exists, then will call the cancel() method after a period of time that equals the value of this property.
title string “” Text that is shown in the header of the widget.
visible boolean true If this property value is set to true, then the widget is visible.

autoBusy boolean

If true then a button will be disabled after a click. The default value is false.

busyLabel string

text displayed while a button is busy. The default value is “Please wait”.

description string

Text under the header of the widget. Default value: “”.

disabled boolean

Specifies if the widget will respond to user input.

Default value: false.

gridSize string

This specifies the widget width that is relevant only for widgets inside Container, FieldSet, or Tiles. In other cases it will be ignored.

gridSize string contains few options with number values (from 1 to 12) separated by spaces, which specify the grid size of the widget in different layouts:

- md - desktop

- xs - phone

For example, gridSize: “md-4 xs-2”.

All values below 1, e.g. “md-0”, will be replaced with the empty string (“”), values above 12, e.g. “md-14”, will be reduced to 12 (“md-12”).

Default value: undefined.

iconName string

Address to the icon. Default value: “”.

isBusy boolean

If a button is disabled then this property is true. The default value is false.

label string

Text that is shown as a label if the widget is placed inside a aps/FieldSet.

Default value: “”.

timeout number

If exists, then will call the cancel() method after a period of time that equals the value of this property. Default value: 0.

title string

Text that is shown in the header of the widget. Default value: “”.

visible boolean

If this property value is set to true, then the widget is visible.

Default value: true.

Public Methods

METHOD RETURN DESCRIPTION
cancel ()
undefined
Returns the widget to its previous state before the click
destroy ()
undefined
Destroys this widget
get ()
any
Get a property of the Stateful instance
getParents ()
array
Discover and return all parents of the widget
makeBusy ()
undefined
Turns the item to the busy state
placeAt ()
dijit/_widgetbase
function
Place this widget somewhere in the DOM based on standard dojo/dom-construct::place() conventions
set ()
object
function
Set a property of the Stateful instance
startup ()
undefined
Gets started after the DOM fragment is added to the document

cancel

Returns the widget to its previous state before the click. To prevent double submission by a user, the widget is switched to the busy or load state automatically each time after the user clicks. To switch the widget back to the enabled state, call the cancel() method in your onClick handler.

Return: undefined

destroy

Destroys this widget. Will also destroy any resources (including widgets) registered via this.own(). This method will also destroy internal widgets such as those created from a template.

Return: undefined

get

Get a property of the Stateful instance. Get a named property of the Stateful object. The property may potentially be retrieved via a getter method in subclasses.

In the base class, this just retrieves the object’s property.

Return: any

getParents

Discover and return all parents of the widget.

Return: array

makeBusy

Turns the item to the busy state. Does a transition between the ‘ready to handle user event’ (isBusy:false) state and the ‘busy’ (isBusy:true) state. Also disables the button (disabled:true)

Return: undefined

placeAt

Place this widget somewhere in the DOM based on standard dojo/dom-construct::place() conventions. A convenience function providing a simple shorthand mechanism to put an existing (or newly created) widget somewhere in the DOM, and allow chaining.

Return: dijit/_widgetbase function

set

Set a property of the Stateful instance. Sets named properties of the stateful object and notifies the watchers of the property. A programmatic setter may be defined in subclasses.

Return: object function

startup

Gets started after the DOM fragment is added to the document Called after the widget and its children have been created and added to the page, and all related widgets have finished their create() cycle, up through postCreate().

Note that startup() may be called while the widget is still hidden, for example if the widget is inside a hidden dijit/Dialog or an unselected tab of a dijit/layout/TabContainer. For widgets that need to do layout, it’s best to put that layout code inside resize(), and then extend dijit/layout/_LayoutWidget so that resize() is called when the widget is visible.

Return: undefined

Public Events

EVENT RETURN DESCRIPTION
onClick ()
boolean
Callback for when button is clicked

onClick

Callback for when button is clicked.