Methods
(static) addModelProcessor(methodName, methodBody, optionsopt)
Adds a model processors function. The model processors are methods identified by a name that must contain the model full path (eg. "Shark.__store.currentUser") and the name of a property of that model (eg. "userName") joined by an underscore.
This method will be automatically called whenever an input on the page, with the right "sh" data tags, triggers it's "change" or "input" event.
The default behaviour is that the content of the field became the value of the property, but if a model processor function exists, it's invoked and then you can change the default behaviour.
This method will be automatically called whenever an input on the page, with the right "sh" data tags, triggers it's "change" or "input" event.
The default behaviour is that the content of the field became the value of the property, but if a model processor function exists, it's invoked and then you can change the default behaviour.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
methodName |
string | The name of the new method. It must contain the model full path, an underscore and the name of a property of that model (eg. "Shark.__store.currentUser_userName"). | |
methodBody |
function | The function that will be executed when the method will be called. | |
options |
object |
<optional> |
An object containing the options. (not used) |
(static) get(itemName, forcedType)
Retrieve values from the main store. It supports object deconstruction
Parameters:
| Name | Type | Description |
|---|---|---|
itemName |
string | array | - |
forcedType |
string | Deprecated |
(static) getInstance(modelNameOrClass, modelDataopt) → {object}
Return an instance of the requested model, filled with the passed data if present.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
modelNameOrClass |
string | The name of the model to instantiate. It must exist: prior of this call you must have called the createModel method withe the same model name and a model definition. |
|
modelData |
object |
<optional> |
An object containing the data to use to fill the new instance. (it just call the instance.parse method) |
Returns:
- Type
- object
(static) init(optionsopt, forceReinitopt)
Parameters:
| Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
An object containing the options for initializing.
Properties
|
||||||||||||||||||||||||||||||||||||
forceReinit |
boolean |
<optional> |
false | If true process initialize step even if the initialization phase has alredy been completed. |
(static) openPage(pageIdOrJaw)
Open the requested View showing it on the screen
Parameters:
| Name | Type | Description |
|---|---|---|
pageIdOrJaw |
string | Jaw | The view to register. |
(static) registerView(jaw)
Register a view that can be used withe the openPage method.
Parameters:
| Name | Type | Description |
|---|---|---|
jaw |
Jaw | The view to register. |