
The template provides an initial skeleton for developing a Backbone.js application in ASP.NET MVC. The Backbone.js SPA template is designed to get you started quickly building interactive client-side web apps using Backbone.js. Breaking Change: the bindKey that was passed into the Backbone change:attr (undocumented) options was changed to stickitChange which is assigned the binding options which have a unique bindId.The Backbone SPA Template was written by Kazi Manzur Rashid.view#unstickit now takes a second, optional, parameter which gives you the control to granularly remove a single, or hash, of bindings.Added an view#addBinding which will initiate a single, or hash, of bindings.Breaking Change: Calling view#stickit a second time with the same model, will no longer unbind all previously bound bindings associated with that model instead, it will unbind any duplicate bindings (selectors) found in the given bindings hash (or whatever's in view.bindings) before initializing.Non-string values can be bound to a pre-rendered dropdown by setting data-stickit-bind-val on elements.view#stickit returns this for easier chaining.Passing a Backbone Collection to selectOptions will keep the select dropdown in sync with add, remove, and sort events on the collection.defaultOption can be defined as a function.Use the new classes hash to bind element classes to your attributes. Breaking Change: Classes are now treated separately from other attribute bindings.Dependenciesīackbone 1.0, underscore.js, and jQuery or Zepto (with data module see selectOptions) Licenseīumped allowed underscore and Backbone versions. Configuration and callbacks should only be in one place - the View/JavaScript. Backbone helps you organize with a strong focus on the model, but stays the hell out of your presentation. If you are writing a custom frontend, then you're going to need to write custom JavaScript. Who wants to program and debug templates? JavaScript frameworks seem to be headed in the wrong direction - controller callbacks/directives, configuration, and special tags are being forced into the template/presentation layer.

The following image demonstrates the order in which bindings callbacks are called after stickit is initialized, a bound model attribute changes, and a bound view element changes. addBinding ( null, '#author', Binding Callbacks Flowchart addBinding ( null, '#author', 'author' ) // With configuration. The following bindings configuration will bind the view.$('#title') element to the title model attribute and the view.$('#author') element to the authorName model attribute: Similar to view.events, you can define view.bindings to map selectors to binding configurations. In Backbone style, Stickit has a simple and flexible api which plugs in nicely to a View's lifecycle. Unlike most model binding plugins, Stickit does not require any extra markup in your html in fact, Stickit will clean up your templates, as you will need to interpolate fewer variables (if any at all) while rendering. Stickit is a Backbone data binding plugin that binds Model attributes to View elements with a myriad of options for fine-tuning a rich app experience. This works beautifully for simple apps, but rich apps often need to render, respond, and synchronize changes with finer granularity. Introductionīackbone's philosophy is for a View, the display of a Model's state, to re-render after any changes have been made to the Model.

#BACKBONE JS PLUGINS CODE#
The following is documentation for the code in master/edge version.


> Documentation for current/stable release: 0.9.2
