Wayfast Javascript Library
Wayfast provides a JS API that allows devs to taylor screen behavior from code snippets.
In this document you can find all methods with high level descriptions, parameters, return values and considerations.
Method | Description | Parameters | Return value |
Wayfast.Controls.Get(string objectIdentifier) | Searches provided object in pages dome and returns a reference to the node. | String value. Can be either html ID or css class. | Returns an object of type WayfastControl that references the dom node. If the object is not found returns null. |
WayfastControl.setValue(string properyName) | Sets the content to the referenced WayfastControl. This method is supported by the following controls:
| String value. If value parameter is null sets controls content to null. | Returns void. |
WayfastControl.Render() | Draws a control in a given placeholder. It is useful when changing a control programatically withou having to render the full page. This method only renders the associated WayfastControl. | Parameterless. | Void |
WayfastControl.Show() | Set's control's visibility to true by setting css display its default. | Parameterless | Void |
WayfastControl.Hide() | Set's control's visibility to true by setting css display to none. | Parameterless | Void |
WayfastControl.clearValue() | Clears WayfastControl's content. This method is supported by the following controls:
| Parameterless | Void |
Wayfast.FormValidation.setFormItemValid(stromg controlName, value) | Used for customizing validations in a form. This method Indicates if a field passed a validation or not. When validation fails changes css to highlight errors in the UI. Requires the following Wayfast variables to be set before using it:
| controlName: String with the name of the WayfastControl (without &). value: boolean indicating if the validation passed or not. When false applies WayfastValidation css class to highlight the control when form validation failed. | void |