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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:07:57+00:00 2026-06-05T08:07:57+00:00

I receive data from a WCF and bind it to a table. I have

  • 0

I receive data from a WCF and bind it to a table. I have been helped in this forum to add some compute fields and everything works perfectly. I’d like to add a total at the footer of this table. a simple version of my page could be seen at http://jsfiddle.net/qeUHd/3/ . Basically I’d like to learn how to add a field to my ViewModel that’s the result of sum of Another field in my sample “Amount”. Any help would be greatly appreciated.
http://jsfiddle.net/qeUHd/3/

  • 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-05T08:07:59+00:00Added an answer on June 5, 2026 at 8:07 am

    In your fiddle, you’re mapping your data set to self.model, so self.model is an observableArray. Since that was the case, I just needed to put together a computed value to get your total.

    http://jsfiddle.net/qeUHd/5/

    self.total = ko.computed(function(){
        var total = 0;
        for(var p = 0; p < self.model().length; ++p)
        {
            total += self.model()[p].Amount();
        }
        return total;
    });
    

    Then just make sure to bind to it.

    <td data-bind="text: total">
    

    You’re doing things a little backward, but I assume it’s due to the way you’re receiving your data, so I dealt with it and moved on.

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

Sidebar

Related Questions

I have been having some issues retrieving JSON data from a WCF service application
I receive data in the following format from the server <ul> <li>Some text</li> <li>Other
I receive some data (JSON encoded) from a PHP script using $.getJSON. It consists
I have written a program to receive a piece of data from a network
I have a data set that I receive from a service. The data comes
I have a WCF service that uses ODP.NET to read data from an Oracle
My WPF application should receive data from pipe via WCF: I'm new to MVVM
I am binding data that I receive from a WCF weather service to a
I get an error with my code to receive data from my android app.
Good day, I receive data from a communication channel and display it. Parallel, I

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.