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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:04:34+00:00 2026-06-16T05:04:34+00:00

I have the next data coming from the server and I want to map

  • 0

I have the next data coming from the server and I want to map this data to my model by calling ko.mapping.fromJS(data, AcquisitionDetailsModel);

By inspecting the AcquisitionDetailsModel, after calling the specified method, I see that the model contains acquisitions: Object[0]. Why? I was expecting to find the array of acquisitions inside my model. What I’m doing wrong?

data: Object
   acquisitions: Array[2]
   0: Object
      acquisition: Object
         date: "2012-06-20"
         __proto__: Object
      provider: Object
         id: "1"
         name: "Some name"
         __proto__: Object
     truck: Object
         mark: "DAF"
         model: "95FX"
         __proto__: Object
     __proto__: Object
  1: Object
  length: 2

The models are looking like this:

function TruckModel() {
    this.mark = ko.observable("");
    this.model = ko.observable("");
}

function AcquisitionModel() {
    this.date = ko.observable("acquisition_date");
}

function ProviderModel() {
    this.id = null;
    this.name = ko.observable("name");
}

var AcquisitionDetailsModel = {
    acquisitions: ko.observableArray([{
        acquisition: new AcquisitionModel(),
        provider: new ProviderModel(),
        truck: new TruckModel()
    }])
}
  • 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-16T05:04:35+00:00Added an answer on June 16, 2026 at 5:04 am

    Actually the mapping was done right but it was me who was doing debugging in the wrong way 🙂

    After ko.mapping.fromJS(data, AcquisitionDetailsModel); if I call AcquisitionDetailsModel.acquisitions() I can see my data.

    Also, by calling AcquisitionDetailsModel.acquisitions()[0].truck.model() I still can see the right data.

    Stupid me 🙂

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

Sidebar

Related Questions

What does this mean: Next add reference to: MySql.Data actually I have downloaded mysql
So, I have this code that grabs a bunch of data from the database,
I have a NSData object coming back from my server, it varies in its
I have data coming in from datastage that is being put in our SQL
In my SQL 2008 SSIS environment, I have data coming from a CSV file
i have a program which process price data coming from the broker. the pseudo
i have question about YAJLiOS parser... I have next json data : {{ body
I have next form and some ashx <form action=FileUpload.ashx method=POST enctype=multipart/form-data id=frmUpload> <input id=fileupload
I have a view that I would like to populate data when the next
I have the following problem: list.c struct nmlist_element_s { void *data; struct nmlist_element_s *next;

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.