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

  • Home
  • SEARCH
  • 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 7580543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:56:38+00:00 2026-05-30T17:56:38+00:00

Please take a look at this example. http://jsfiddle.net/LdeWK/2/ I want to know how to

  • 0

Please take a look at this example.
http://jsfiddle.net/LdeWK/2/

I want to know how to bind values of an observable array. I know the problem in the example above, it is this line

<p>Editing Fruit: <input data-bind="value: $data" /></p>

$data is the actual value, not the observable function that you would normally bind.
This seems like it should be a pretty straight forward process, however I cant figure it out.

In other cases I have used observable arrays and had an observable object as each element of the observable array. I wanted to know how to get this to work with just observable array.

Thanks

  • 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-05-30T17:56:39+00:00Added an answer on May 30, 2026 at 5:56 pm

    If you are binding read/write to items in an array or an observableArray, then they will need to be a property of an object. Otherwise, $data will be the unwrapped observable and there is no way for KO to write to the actual observable.

    You would have to do something like:

    var ViewModel = function(myFruit) {
        var observableFruit = ko.utils.arrayMap(myFruit, function(fruit) {
            return { name: ko.observable(fruit) }; 
        });
        this.fruit = ko.observableArray(observableFruit);
    };
    
    
    ko.applyBindings(new ViewModel( ["Apple", "banana", "orange"] )); 
    

    Here is a sample: http://jsfiddle.net/rniemeyer/LdeWK/3/

    The individual fruits do not necessarily need to be observable, unless you need your UI to react to the values changing (your sample does need to react, as you are showing the a read-only list of the fruits).

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

Sidebar

Related Questions

Please take a look at this example in Chrome browser: http://jsfiddle.net/ymzTB/ <form> <input required
Well Im stucked at this point.please take a look at this http://jsfiddle.net/karthik64/5jhgF/3/ Okay first
Hi, Pleas take look at this example : http://jsfiddle.net/snowman/Hne3h/1/ If you hover over the
Please take a look at this fiddle: http://jsfiddle.net/d3uc9/4/ I have a problem with this,
Please take a look at this example: #include <iostream> #include <vector> #include <string> using
Please take a look at this very short example fieldset, legend, .TLabel, .TComboBox, .select,
please take a look of this, the file demo.php is an example of the
Please, take a look at this example: import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Test
Before I ask my question, please take a look at this example function: DateTime.TryParse(01/01/2000,
Please take a look at this spider example in Scrapy documentation. The explanation is:

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.