view.attributes

attributesview.attributes A hash of attributes that will be set as HTML DOM element attributes on the view's el (id, class, data-properties, etc.), or a function that returns such a hash.

view.$el

$elview.$el A cached jQuery object for the view's element. A handy reference instead of re-wrapping the DOM element all the time. view.$el.show(); listView.$el.append(itemView.el);

View

constructor / initializenew View([options]) There are several special options that, if passed, will be attached directly to the view: model, collection, el, id, className, tagName, attributes and events. If the view defines an initialize function, it will be called when the view is first created. If you'd like to create a view that references an element already in the DOM, pass in the element as an option: new View({el: existingElement}) var doc = documents.first(); new DocumentRow({ mod

sort event

"sort" (collection, options) â when the collection has been re-sorted.

sync event

"sync" (model_or_collection, response, options) â when a model or collection has been successfully synced with the server.

update event

"update" (collection, options) â single event triggered after any number of models have been added or removed from a collection.

router.routes

routesrouter.routes The routes hash maps URLs with parameters to functions on your router (or just direct function definitions, if you prefer), similar to the View's events hash. Routes can contain parameter parts, :param, which match a single URL component between slashes; and splat parts *splat, which can match any number of URL components. Part of a route can be made optional by surrounding it in parentheses (/:optional). For example, a route of "search/:query/p:page" will match a fragme

router.navigate

navigaterouter.navigate(fragment, [options]) Whenever you reach a point in your application that you'd like to save as a URL, call navigate in order to update the URL. If you also wish to call the route function, set the trigger option to true. To update the URL without creating an entry in the browser's history, set the replace option to true. openPage: function(pageNumber) { this.document.pages.at(pageNumber).open(); this.navigate("page/" + pageNumber); } # Or ... app.navigate("help

Router.extend

extendBackbone.Router.extend(properties, [classProperties]) Get started by creating a custom router class. Define actions that are triggered when certain URL fragments are matched, and provide a routes hash that pairs routes to actions. Note that you'll want to avoid using a leading slash in your route definitions: var Workspace = Backbone.Router.extend({ routes: { "help": "help", // #help "search/:query": "search", // #search/kiwis "search/:query/p

router.route

routerouter.route(route, name, [callback]) Manually create a route for the router, The route argument may be a routing string or regular expression. Each matching capture from the route or regular expression will be passed as an argument to the callback. The name argument will be triggered as a "route:name" event whenever the route is matched. If the callback argument is omitted router[name] will be used instead. Routes added later may override previously declared routes. initialize: functi