new PathsWidget(options)
Widget which allows the configuration of multiple file paths
Parameters:
| Name | Type | Description |
|---|---|---|
options |
PathsWidgetOptions | Options for the widget |
- Source:
Extends
Members
-
className :string
-
Classes applied to the widget. Override if using Bootstrap 3
Type:
- string
- Inherited From:
- Default Value:
-
- row-fluid accordion-group
- Source:
-
controlGroupClass
-
Class applied to control groups. Set to 'form-group' if using Bootstrap 3
- Inherited From:
- Default Value:
-
- control-group
- Source:
-
errorClass
-
Class used to indicate failed validation. Set to 'has-error' if using Bootstrap 3
- Inherited From:
- Default Value:
-
- error
- Source:
-
formControlClass
-
Class applied to form controls. Set to 'form-control' if using Bootstrap 3
- Inherited From:
- Default Value:
-
- ''
- Source:
-
itemTemplate :module:settings/js/widgets/path-widget.PathWidget~PathTemplate
-
Template for each individual row. Override if using Bootstrap 3
Type:
- Source:
-
successClass
-
Class used to indicate successful validation. Set to 'has-success' if using Bootstrap 3
- Inherited From:
- Default Value:
-
- success
- Source:
-
template :module:settings/js/widgets/paths-widget.PathsWidget~PathsTemplate
-
Base template for the widget. Override if using Bootstrap 3
Type:
- Source:
-
widgetTemplate :module:settings/js/widget.Widget~WidgetTemplate
-
Base template for the widget. Override if using Bootstrap 3
Type:
- Inherited From:
- Source:
Methods
-
getConfig() → {PathsConfig}
-
Gets the configuration associated with the widget
- Source:
Returns:
The configuration associated with the widget
- Type
- PathsConfig
-
getName() → {string}
-
Gets the name for the widget
- Inherited From:
- Deprecated:
-
- Users of this class do not need to call this
- Source:
Returns:
this.serverName, or this.configItem if serverName is undefined
- Type
- string
-
handleInputChange()
-
Handler for change events on any inputs in the widget. Calls hideValidationInfo and
setValidationFormatting- Inherited From:
- Source:
-
<abstract> handleValidation(config, response) → {boolean}
-
Handles the results of server side validation (several widgets have a Test Connection button to do
this). Override this method if your widget needs server side validationParameters:
Name Type Description configobject The configuration object for the widget
responseValidationResponse The validation response from the server
- Inherited From:
- Source:
Returns:
True if the widget is valid; false otherwise
- Type
- boolean
-
hideValidationInfo()
-
Hides any validation information (elements with the settings-client-validation class)
- Inherited From:
- Source:
-
render()
-
Renders the widget
- Source:
-
setValidationFormatting(state)
-
Removes this.successClass and this.errorClass from elements in the widget with this.controlGroupClass.
If state === 'clear', remove successClass and errorClass from this.$el. Otherwise adds the given class
and removes the other classParameters:
Name Type Description statestring clear to remove classes, otherwise this.successClass or this.errorClass to add that
class and remove the other class- Inherited From:
- Source:
-
<abstract> shouldValidate() → {boolean}
-
Returns false by default; override it to return true if your widget needs client side validation
- Inherited From:
- Source:
Returns:
True if the widget should validate; false otherwise
- Type
- boolean
-
updateConfig(config)
-
Updates the widget with the given configuration
Parameters:
Name Type Description configPathsConfig The new configuration
- Source:
-
<protected> updateInputValidation($input, isValid)
-
Updates the formatting of the given input
If isValid is true, removes errorClass from the input and hides elements with the class
settings-client-validationIf isValid is false, adds errorClass to the input and shows elements with the class
settings-client-validationParameters:
Name Type Description $inputjQuery The input to apply the classes to
isValidboolean True if the input is valid; false otherwise
- Inherited From:
- Source:
-
<protected> updateRemoveButtons()
-
Disables the remove buttons when the number of inputs reaches 1, enables them otherwise
- Source:
-
validateInputs() → {boolean}
-
Validates the widget and applies formatting accordingly
- Source:
Returns:
False if any of the paths is empty; true otherwise
- Type
- boolean
Type Definitions
-
PathsTemplate(parameters)
-
Parameters:
Name Type Description parametersPathsWidgetTemplateParameters - Source: