Sha256: 5ef6fae71cab359a2801b8229141cf25d7b5144e2f1309218313ed674bf9bee5

Contents?: true

Size: 1003 Bytes

Versions: 18

Compression:

Stored size: 1003 Bytes

Contents

// Category View
// =============

// Includes file dependencies
define([ "jquery", "backbone","models/CategoryModel" ], function( $, Backbone, CategoryModel ) {

    // Extends Backbone.View
    var CategoryView = Backbone.View.extend( {

        // The View Constructor
        initialize: function() {

            // The render method is called when Category Models are added to the Collection
            this.collection.on( "added", this.render, this );

        },

        // Renders all of the Category models on the UI
        render: function() {

            // Sets the view's template property
            this.template = _.template( $( "script#categoryItems" ).html(), { "collection": this.collection } );

            // Renders the view's template inside of the current listview element
            this.$el.find("ul").html(this.template);

            // Maintains chainability
            return this;

        }

    } );

    // Returns the View class
    return CategoryView;

} );

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
RubyApp-0.7.16 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.15 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.14 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.13 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.12 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.11 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.10 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.9 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.5 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.4 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.3 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.2 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.1 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.7.0 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.6.71 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.6.70 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.6.69 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js
RubyApp-0.6.68 lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js