Class FormView
Extends
Backbone.View.
FormView
Defined in: formview.js.
Constructor Attributes | Constructor Name and Description |
---|---|
FormView()
Comment form controller and view
|
Field Attributes | Field Name and Description |
---|---|
CSS class name of the container element
|
|
The map of delegated event handlers
|
|
Html tag name of the container element that'll be created when initializing new instance.
|
Method Attributes | Method Name and Description |
---|---|
cancel()
Cancel button click handler
Cleans up form view from DOM
|
|
View init method, subscribing to model events
|
|
remove()
Override the default view remove method with custom actions
|
|
render()
Render form element from a template using Mustache
|
|
submit()
Submit button click handler
Sets new values from form on model, triggers a success event and cleans up the form
|
|
Update view if the model changes, helps keep two edit forms for the same model in sync
|
Field Detail
{String}
className
CSS class name of the container element
{Object}
events
The map of delegated event handlers
{String}
tagName
Html tag name of the container element that'll be created when initializing new instance.
This container is then accessible via the this.el (native DOM node) or this.$el (jQuery node)
variables.
Method Detail
{Boolean}
cancel()
Cancel button click handler
Cleans up form view from DOM
- Returns:
- {Boolean} Returns false to stop propagation
initialize()
View init method, subscribing to model events
remove()
Override the default view remove method with custom actions
{FormView}
render()
Render form element from a template using Mustache
- Returns:
- {FormView} Returns the view instance itself, to allow chaining view commands.
{Boolean}
submit()
Submit button click handler
Sets new values from form on model, triggers a success event and cleans up the form
- Returns:
- {Boolean} Returns false to stop propagation
{Boolean}
updateFields()
Update view if the model changes, helps keep two edit forms for the same model in sync
- Returns:
- {Boolean} Returns false to stop propagation