Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9192205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:52:00+00:00 2026-06-17T20:52:00+00:00

I try to render view when model changes. Could you please tell why this

  • 0

I try to render view when model changes.
Could you please tell why this code doens’t wok?

var TodoView = Backbone.View.extend({
    initialize: function() {
        this.model.on('change', this.render, this);
    },
});

It gives error:

TypeError: this.model.on is not a function

But it looks like this code works:

var TodoView = Backbone.View.extend({
    initialize: function() {
            _.bindAll(this, 'render');  
        this.model.bind('change', this.render);  
    },
});

These libraries are used:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://ajax.cdnjs.com/ajax/libs/underscore.js/1.1.4/underscore-min.js"></script>
<script src="http://ajax.cdnjs.com/ajax/libs/backbone.js/0.3.3/backbone-min.js"></script>   
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:52:01+00:00Added an answer on June 17, 2026 at 8:52 pm

    The on and off methods were added to Backbone in version 0.9.0, and it looks like you are still version 0.3.3. You can continue to use bind and unbind. The new on/off methods are just aliases for the same thing.

    Alternatively you should consider updating your Backbone version. Since 0.3.3 there have been hundreds of other improvements and bugfixes to Backbone, so you should update to the newest (0.9.10) if you’re able. At the same time you need to update underscore to version >= 1.4.3

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

collection and view in back bone var studentmodel = Backbone.Model.extend(); var studentcollection = Backbone.Collection.extend({
When I try to render a partial view whose model type is specified as:
Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]
Try this piece of code - public class WhitespaceTest { public static void main(String[]
I'm writing a sample app using backbone.js. On update of my model I re-render
I have a mvc web project where I try to render a list of
I defined a composite component (actually a few) and when I try to re-render
try: recursive_function() except RuntimeError e: # is this a max. recursion depth exceeded exception?
I have this models: class Balanta(models.Model): data = models.DateField() class Conturi(models.Model): cont=models.PositiveIntegerField() cont_debit=models.DecimalField(default=0, max_digits=30,
Just tried writing a simple validates_presence_of in my model, and when the errors try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.