using backbone.js

wiki  and ticket software osticket, twiki

 var Occupant = Backbone.Model.extend();
        var occupant = new Occupant(data);
        var OccupantView = Backbone.View.extend({
            // shortened for brevity..
              //... is a list tag.
            tagName:  "li",
             // Cache the template function for a single item.
            template: _.template($('#tmpl_occupant').html()),
            
            // a one-to-one correspondence between a **Todo** and a **TodoView** in this
            // app, we set a direct reference on the model for convenience.
            initialize: function() {
            
                _.bindAll(this, 'render', 'close');
                this.model.bind('change', this.render);
                this.model.view = this;
            },
            // Re-render the contents of the todo item.
            render: function() {
                $(this.el).html(this.template(this.model.toJSON()));
                return this;
            }
            
        });
        var view = new OccupantView({model: occupant});

        $("#occupant-list").append(view.render().el);

http://www.plexical.com/blog/2010/11/18/backbone-js-tutorial/

Ref :

http://documentcloud.github.com/backbone/examples/todos/index.html

Advertisements

About rahul23134654

Hi, I am Rahul Meha , B.E. in (I.T.)
This entry was posted in UI Js. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s