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 6661205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:15:02+00:00 2026-05-26T02:15:02+00:00

I have a FormView which handles such events as save and cancel. I also

  • 0

I have a FormView which handles such events as save and cancel. I also have an AjaxFormView that handles save, cancel and get form by ajax. I have an AssetFormView that handles save, cancel, get by ajax, delete, and print.
So on and so forth. there is considerable repitition.

I found a post this post http://kalimotxocoding.blogspot.com/2011/03/playing-with-backbonejs-views.html

where he shows you can extend views. However, I’m finding that when i have multiple versions of views on the page there are properties cross pollinating. Is there no built in way to inherit views in backbone, that is safe?

Thanks,

Raif

* hmmm well, this stuff is pretty thick and my current cross pollination issue may be ( probably is ) the result of some error on my part, but the question still stands, is there not and would it not be an important feature to have, some way to inherit views?

  • 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-05-26T02:15:03+00:00Added an answer on May 26, 2026 at 2:15 am

    I’d like to see what you mean when you say that your properties are cross-pollenating.

    The View.extend mechanism works quite well. Do be aware, though, that you are extending one prototype with new functions. With prototypical inheritance, the prototype shares it’s objects with the new instances.

    I am guessing that when you say that your properties are “cross-pollenating”, you are actually doing something like this:

    var baseModel = Backbone.Model.extend({
        defaults: {
            foo: { bar: "baz" }
        }
    });
    

    Since the objects are shared, every instance of baseModel ends up having the same object for foo, giving the feeling of cross-pollination.

    If instead, you define your defaults as a function, then each instance will get it’s own copy of the foo object and your cross-pollination goes away.

    var baseModel = Backbone.Model.extend({
        defaults: function() { return {
            foo: { bar: "baz" }
        } }
    });
    

    Of course, without code, we can’t be certain to what your problem is. Just know that this mechanism has been well-used among the community without trouble. It is safe. You just need to understand what is going on.

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

Sidebar

Related Questions

I have a FormView which I would like to open in insert mode only
I have - for instance - an asp:FormView which supports Read, Insert, Update, Delete
I have an asp:FormView on a control (in an ascx file) which is loaded
the problem is that I do have an ASP.NET TextBox in a FormView with
I have a FormView through which I set up the default new , update
I have a backbone view - which when called presents a form $('#add-offer').click(function() {
I have to implement an Form View, or in other words: A class that
I have a textbox in a formview that gets its data from a linqdatasource
I have a form which has a date. I registered a customDateEditor for converting
In ASP.NET, I have a FormView which is bound to an ObjectDataSource. The FormView

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.