Class CommentView
Extends
Backbone.View.
CommentView
Defined in: commentview.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Comment controller and view
DOM event and comment model event handlers should live here.
|
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 |
---|---|
edit()
Edit button click handler
|
|
handleEditSuccess(model)
Handles form save success event
|
|
View init method, subscribing to model events
|
|
remove()
Override the default view remove method with custom actions
|
|
render()
Render the new comment DOM element from a template using Mustache
|
|
reverse()
"Reverse" button click handler
|
Class Detail
CommentView()
Comment controller and view
DOM event and comment model event handlers should live here.
This view handles comment edit, delete and the sample text reverse actions, also
listens to model change and destroy events to update the view in DOM.
Author: Bodnar Istvan.
Author: Bodnar Istvan
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}
edit()
Edit button click handler
- Returns:
- {Boolean} Returns false to stop propagation
handleEditSuccess(model)
Handles form save success event
- Parameters:
- model
initialize()
View init method, subscribing to model events
remove()
Override the default view remove method with custom actions
{CommentView}
render()
Render the new comment DOM element from a template using Mustache
- Returns:
- {CommentView} Returns the view instance itself, to allow chaining view commands.
{Boolean}
reverse()
"Reverse" button click handler
- Returns:
- {Boolean} Returns false to stop propagation