Maslosoft Framework Documentation
Flexible Application Foundation
Toolbar Button
This buttons are strictly prepared to work with Toolbar.
Usually button is not instantiated directly, but rather by configuring
toobar. It uses by default ActionButton
class, but others can be used
too.
There are numerous possible options to configure for each button:
Property | Documentation |
---|---|
$action |
Action to execute on user interaction. This should be string or object holding reference to JavaScript function. This might be related to other settings, like |
$active |
Whether button is in active state. Pass JavaScript reference as value to make it react on state changes. |
$after |
Extra html to add after toolbar, for modals etc. It is not recommended to use this. Better use following snippet to add extra html: |
$binding |
Base binding. This will be prepended to This should be either string pointing
to JavaScript reference or object holding
JavaScript reference, for instance |
$class |
|
$confirm |
Confirm message. Setting this will make button confirmable. |
$defaultClasses |
Default button classes, override to render unusual button style. |
$disabled |
Disable button state. This can be either:
|
$disabledClass |
|
$hotkey |
Keyboard shortcut for keyboard users. This might improve user experience dramatically in some cases, while in others will disturb. Use on your own judgment and after checking shortcut in different browsers. This should be string representing shortcut, preferably with some modifiers, ie:
|
$hotkeyScope |
Scope for using shortcut only in specified context. |
$hotkeyScopeLabel |
Label for scope. |
$hover |
Hover action. This must have value of JavaScript reference to function, which will be called when hovering over button. This property is useful when adding overlays on hover to indicate expected changes. |
$icon |
Icon name. This should be set to CSS class providing either font icon or sprite icon appearance. |
$introMessage |
Message to be displayed before action |
$introMessageType |
Message type for |
$label |
Optional label to be shown near or instead of icon. One of |
$param |
Extra params to pass to button action |
$tag |
Tag used to create button |
$target |
Link target if used together with |
$tip |
Tooltip for displaying on hover. |
$toggle |
Whether button is a toggle type. This can be further controller by other toggle related properties. |
$toggleClass |
Class to be used when button is toggled |
$toggleEnabled |
Set toggle state either by passing boolean value or JavaScript reference to observable to control it's value. |
$toggleStateful |
Whether to restore button state on page reload. |
$tooltipPlacement |
|
$type |
Button type. One of
This will alter button appearance. |
$url |
Set URL alternatively to action, to use as a link button. This should be string, or any object that will return
URL when casting to string, for instance |
$visible |
Whether buttons is visible. Use boolean value to statically set visibility. To make it react on state changes, use string or object
pointing to JavaScript observable value. Any object
which will return JavaScript reference when casted to string
will do the job. However it is recommended to use
|