collection.add

addcollection.add(models, [options]) Add a model (or an array of models) to the collection, firing an "add" event for each model, and an "update" event afterwards. If a model property is defined, you may also pass raw attributes objects, and have them be vivified as instances of the model. Returns the added (or preexisting, if duplicate) models. Pass {at: index} to splice the model into the collection at the specified index. If you're adding models to the collection that are already in the co

Collection

constructor / initializenew Backbone.Collection([models], [options]) When creating a Collection, you may choose to pass in the initial array of models. The collection's comparator may be included as an option. Passing false as the comparator option will prevent sorting. If you define an initialize function, it will be invoked when the collection is created. There are a couple of options that, if provided, are attached to the collection directly: model and comparator. Pass null for models to c

change:[attribute] event

"change:[attribute]" (model, value, options) â when a specific attribute has been updated.

change event

"change" (model, options) â when a model's attributes have changed.

Backbone.trigger

triggerobject.trigger(event, [*args]) Trigger callbacks for the given event, or space-delimited list of events. Subsequent arguments to trigger will be passed along to the event callbacks.

Backbone.sync

Backbone.stopListening

stopListeningobject.stopListening([other], [event], [callback]) Tell an object to stop listening to events. Either call stopListening with no arguments to have the object remove all of its registered callbacks ... or be more precise by telling it to remove just the events it's listening to on a specific object, or a specific event, or just a specific callback. view.stopListening(); view.stopListening(model);

Backbone.once

onceobject.once(event, callback, [context]) Just like on, but causes the bound callback to fire only once before being removed. Handy for saying "the next time that X happens, do this". When multiple events are passed in using the space separated syntax, the event will fire once for every event you passed in, not once for a combination of all events

Backbone.on

onobject.on(event, callback, [context])Alias: bind Bind a callback function to an object. The callback will be invoked whenever the event is fired. If you have a large number of different events on a page, the convention is to use colons to namespace them: "poll:start", or "change:selection". The event string may also be a space-delimited list of several events... book.on("change:title change:author", ...); Callbacks bound to the special "all" event will be triggered when any event occurs

Backbone.off

offobject.off([event], [callback], [context])Alias: unbind Remove a previously-bound callback function from an object. If no context is specified, all of the versions of the callback with different contexts will be removed. If no callback is specified, all callbacks for the event will be removed. If no event is specified, callbacks for all events will be removed. // Removes just the `onChange` callback. object.off("change", onChange); // Removes all "change" callbacks. object.off("change")