new View()
The picasso View entity
- Source:
Extends
Members
-
<protected> _formBuilder :Picasso.form.Builder
-
The dynamic form builder
Type:
- Source:
-
<protected> _model :Picasso.Model
-
Type:
- Source:
-
<protected> _modelEvents :Object.<string, function()>
-
Stores the models events callbacks
Type:
- Object.<string, function()>
- Source:
-
dom :HTMLObjectElement
-
The main object of the view
Type:
- HTMLObjectElement
- Source:
Methods
-
<static> extend(constructor) → {function}
-
Extends from a View
Parameters:
Name Type Description constructor
function The constructor to extend - Source:
Returns:
The updated constructor- Type
- function
-
<protected> _subscribe(eventType, callback, context)
-
Subscribes a new observer
Parameters:
Name Type Description eventType
string callback
function context
Object - Inherited From:
- Source:
Throws:
Picasso.error.InvalidParameters -
<protected> _unsubscribe(eventType, callback, context)
-
Removes a observer of a event. If, only the eventType is given, removes all observers of this event type. If callback is given, removes all observers that calls this callback. And finnaly, if context is given too, removes if match the eventType, callback and context.
Parameters:
Name Type Description eventType
string callback
function context
Object - Inherited From:
- Source:
Throws:
-
bindFormData()
-
Binds the model properties to the form fields.
- Source:
-
buildForm(formJSON) → {Picasso.form.PicassoForm}
-
Builds a picasso form object from the given JSON
Parameters:
Name Type Description formJSON
Object - Source:
Returns:
-
construct(dom)
-
Default constructor of a view
Parameters:
Name Type Description dom
HTMLObjectElement - Source:
-
fire(eventType, eventData, context)
-
Fires a event, calling all the observers of this event
Parameters:
Name Type Description eventType
string eventData
* context
Object - Inherited From:
- Source:
Throws:
-
getForm() → {Picasso.form.PicassoForm}
-
Gets the view form
- Source:
Returns:
-
register(eventName, method)
-
Registers a model event
Parameters:
Name Type Description eventName
string method
function - Source:
-
setForm(pForm)
-
Sets the view form
Parameters:
Name Type Description pForm
Picasso.form.PicassoForm - Source:
-
setModel(model)
-
Set a model to this view
Parameters:
Name Type Description model
Picasso.Model - Source: