new EnableView(options)
Utility control for widgets which may be disabled
Parameters:
| Name | Type | Description |
|---|---|---|
options |
EnableViewOptions |
- Source:
Extends
- Backbone.View
Members
-
className
-
Classname for view. Override if using Bootstrap 3
- Default Value:
-
- control-group
- Source:
Methods
-
getConfig() → {boolean}
-
Returns the current state of the view
- Source:
Returns:
True if the widget is enabled; false otherwise
- Type
- boolean
-
render()
-
Renders the view
- Source:
-
toggleEnabled()
-
Changes the enabled state to its negation and calls updateFormatting
- Source:
Fires:
- event:change Event fired with the new state of the view
-
updateConfig(config)
-
Set the state of the view. Calls updateFormatting
Parameters:
Name Type Description configboolean True if the view is enabled; false otherwise
- Source:
-
updateFormatting()
-
Updates the formatting of the view.
If the view is enabled, sets the CSS class of the button to btn-danger, the icon to icon-remove, the button
text to this.strings.disable, and the label to this.strings.enabled.If the view is disabled, sets the CSS class of the button to btn-success, the icon to options.enableIcon, the
button text to this.strings.enable and the label to this.strings.disabled- Source: