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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:40:12+00:00 2026-06-16T17:40:12+00:00

I’m using the knockout mapping plugin to auto-create my views for me, and they’re

  • 0

I’m using the knockout mapping plugin to auto-create my views for me, and they’re working fine.

However, I’m using Raphael.js to produce a gauge based on the values in my mapped object, but I noticed that the gauge would get re-drawn for every observable that was updated. Given that there are a large number of these gauges on the page, having them each re-drawn three times each time I get new data back from an AJAX call is not great for performance.

So, I’ve changed all but one of the properties on the object to normal javascript properties, using copy in the mapping options.

Now the issue I have is that the one observable property is being updated before all of the straight javascript properties have been updated, so parts of the gauge are out of sync. Specifically, the observable property is DisplayValue, which I output as text in the middle of the gauge, whereas I also have a normal property PercentValue that I use to actually draw the line on the gauge. So DisplayValue is updating before PercentValue, which causes the gauge to be re-drawn, meaning that the line on the gauge always shows the last PercentValue, not the current one.

I’ve looked at the throttle extender, and it appears that I’d have to add in a computed property that contained both my observables for this to work, but I don’t like the idea of having to add a property in just to get this functionality. Equally, I assume that I could add an observable property (LastUpdated, for example) and manually update that after the whole object has been updated, but that also feels unsatisfactory.

There does appear to be an issue raised for a combinedObservable, so I guess that there is no way of doing this at the moment in the way I’d like.

So, is there a better way of doing this entirely? Is there some way of getting the normal javascript properties to be updated before the observables? I’m guessing that the properties are processed alphabetically?

  • 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-16T17:40:14+00:00Added an answer on June 16, 2026 at 5:40 pm

    I’ve mostly implemented RP’s suggestion, but as he put it as a comment, and I’ve implemented it slightly differently, I thought I’d answer it here in full, in case it’s any use to anyone else.

    I’ve made all the properties that my gauge uses normal JS properties, rather than leaving the DisplayValue as an observable, but I’ve added a new observable property to the object, called updated. Once I’ve used the mapping plugin to copy the new data over to the existing object, I use the valueHasMutated method RP mentioned above.

    ko.mapping.fromJS(point, existingPoint);
    existingPoint.updated.valueHasMutated();
    

    I’ve got a knockout custom binding handler which I tie to the observable property using

    ko.utils.unwrapObservable(viewModel.updated);
    

    and now I only get one update event fired. Obviously, I still don’t think that this is ideal, but unless the mapping plugin gets an option to only fire that an observable has been updated once it has copied all the normal properties over, this is probably the best option.

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

Sidebar

Related Questions

I am using Paperclip to handle profile photo uploads in my app. They upload
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am using JSon response to parse title,date content and thumbnail images and place
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.