Button

The Button Class provides properties, methods, and events to interface with the HTML tags generated by the <silk:Button> tag.

Kind: global class

Properties

Name
Type
Description

$button

Object

jQuery object referencing to the button HTML tag.

validationFunction

funtion

A function to be executed to validate if the click event should be triggered. Undefined by default.

Methods and Event

new Button(buttonID, options)

Returns a Button instance.

Param
Type
Description

buttonID

String

Button's name and unique identifier.

options

Object

Object containing the configuration.

[option.targetPage]

String

The page to activate if clicked.

[option.confirmTitle]

String

The confirmation dialog title.

[option.confirmMessage]

String

The confirmation dialog message.

[option.confirmLabel]

String

The confirmation dialog button's label.

[option.confirmIcon]

String

The confirmation dialog icon.

[option.toggleList]

String

The list of comma separated elements which will be toggle together with the component.

click()

Fires the click action programatically. Ignore confirmation if configured.

Kind: instance method of Button

confirm()

Fires the click action programatically after triggering the confirmation dialog and getting an answer.

Kind: instance method of Button

disable(mode)

Disables the Action changes based on the provided parameter.

Kind: instance method of Button

Param
Type
Default
Description

mode

boolean

true

True disables and false enables.

enable(mode)

Enables the Action changes based on the provided parameter.

Kind: instance method of Button

Param
Type
Default
Description

mode

boolean

true

True enables and false disables

getLabel() ⇒ String

Gets the button's label.

Kind: instance method of Button

getNeedsConfirmation() ⇒ Boolean

Return true if the button will ask for confirmation.

Kind: instance method of Button

go()

Trigers the show method in the targetPage.

Kind: instance method of Button

hide()

Hides the button

Kind: instance method of Button

on

Extends the "on" method from the eventManager Class.

Kind: instance property of Button

Param
Type
Description

eventName

String

The event's name.

eventFunction

function

The function to be triggered.

setConfirmLabel(label)

Sets the confirmation button's' label

Kind: instance method of Button

Param
Type
Description

label

String

The button's label

setConfirmMessage(message)

Sets the confirmation dialog message

Kind: instance method of Button

Param
Type
Description

message

String

The new message

setConfirmTitle(title)

Sets the confirmation dialog title

Kind: instance method of Button

Param
Type
Description

title

String

The new title

setLabel(label)

Sets the button's label.

Kind: instance method of Button

Param
Type
Description

label

string

The text of the new label.

show()

Shows the button

Kind: instance method of Button

toggle(status)

Hides or shows the button based on the provided parameter.

Kind: instance method of Button

Param
Type
Description

status

boolean

True shows and false hides.

on:click

Event triggered when the Button is clicked. Created with the Button.on("click", function(){}) method.

Kind: event emitted by Button