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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:02:19+00:00 2026-06-03T02:02:19+00:00

How to connect changes some field in model to reflect on view ? I

  • 0

How to connect changes some field in model to reflect on view ?
I have model which holds font-weight and I have that model in view, but how to connect changes of font-weight filed in model to reflect on el from view ?

  • 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-03T02:02:20+00:00Added an answer on June 3, 2026 at 2:02 am

    There are several approachs that can be applied here on depending that how much delicate you want to be.

    1. re-render the whole View any time the Model change

    initialize: function(){
      this.model.on( "change", this.render, this );
    }
    

    2. be more precise and only re-render what is needed

    initialize: function(){
      this.model.on( "change:title", this.renderTitle, this );
      this.model.on( "change:body", this.renderBody, this );
      this.model.on( "change:fontWeight", this.renderFontWeight, this );
    }
    

    This needs the company of minimal render methods that modify the DOM as a surgeon:

    renderTitle: function(){
      this.$el.find( "h1" ).html( this.model.get( "title" ) );  
    },
    
    renderBody: function(){
      this.$el.find( "p" ).html( this.model.get( "body" ) );  
    },
    
    renderFontWeight: function(){
      this.$el.find( "p" ).css( "font-weight", this.model.get( "fontWeight" ) );
    }
    

    3. use subviews for every part of the Model

    I’m not offering any example for this approach because the implementation can be more complex. Just think that your actual View is instantiating several SubViews, one for the title, other for the body, and so on. Each one with its own render and binding the changes in its concrete Model attribute and re-render when the attribute changes.

    You can check working jsFiddle code for the approachs 1. and 2.

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

Sidebar

Related Questions

I have a some code, but I don't now how to connect this with
HI All, I need to display some text in text view, but i want
My Facebook connect stopped working on TopTopGames.com for some reason. I have no idea
I have a Custom DirectShow Video Renderer Filter which has some extended features over
Some background: I have an database that I want to use linq-to-sql to update
I have some complex code. Complex, but it was working. The I wanted to
I'm using WWW::Mechanize::Firefox to crawl pages that load some JavaScript after they have been
Facebook Connect and their Social Widgets documentation mention that you need to add an
I have implemented Facebook Connect into a HTML page exactly as the tutorial explains
I am able to connect to an Oracle database using several tools, but am

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.