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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:24:05+00:00 2026-06-17T12:24:05+00:00

Using knockoutjs mapping plugin is it possible to only make the child elements observables?

  • 0

Using knockoutjs mapping plugin is it possible to only make the child elements observables?

I have a large amount of data in the format below (400/500 records) the automatic mapping is really slow as its making every fields observable but I only need to make children observable.

How would I manually make only the children fields observable while ignoring others?

Also, what’s the best way to deal with last amount of data? Any server-side paging with knockoutjs code would be great.

Thanks.

{
    "name": "John Smith",
    "age": 32,
    "employed": true,
    "address": {
        "street": "701 First Ave.",
        "city": "Sunnyvale, CA 95125",
        "country": "United States"
    },
    "children": [
        {
            "name": "Richard",
            "age": 7
        },
        {
            "name": "Susan",
            "age": 4
        },
        {
            "name": "James",
            "age": 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-17T12:24:06+00:00Added an answer on June 17, 2026 at 12:24 pm

    You don’t have to pass in the whole object into the mapping function, just the parts that you want mapped. Since you want to just map the children array, pass that into the mapper.

    var data = {
        "name": "John Smith",
        "age": 32,
        "employed": true,
        "address": {
            "street": "701 First Ave.",
            "city": "Sunnyvale, CA 95125",
            "country": "United States"
        },
        "children": [
            {
                "name": "Richard",
                "age": 7
            },
            {
                "name": "Susan",
                "age": 4
            },
            {
                "name": "James",
                "age": 3
            }
        ]
    };
    
    data.children = ko.mapping.fromJS(data.children);
    

    Otherwise, you could use the mapping options to specify that you want to copy the other fields over (as opposed to mapping them).

    var mappingOptions = {
      'copy': [
        'name',
        'age',
        'employed',
        'address'
      ]
    };
    var mapped = ko.mapping.fromJS(data, mappingOptions);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page using KnockoutJS, with a somewhat large count of observables (about
I am using asp.net mvc 3 and knockoutjs 2.0 and mapping plugin I have
I'm using the knockout mapping plugin to create a viewmodel from data that has
I'm using the knockout mapping plugin, previously I would have set a subscribe like
Using knockoutjs, i'm attempting to map a large and complex piece of data. I'm
I'm using knockoutjs and the mapping plugin to generate view models from JSON returned
Background: I've got a single-page knockout.js app using the mapping plugin. The data is
I'm using a combination of Knockout.js + the Knockout mapping plugin + jQuery in
I have a simple HTML table which is bound using knockoutJS. However, I've added
I'm using the knockout mapping plugin to auto-create my views for me, and they're

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.