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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:47:16+00:00 2026-06-06T11:47:16+00:00

I am new to Knockout.js, I have created an observable array and initialized with

  • 0

I am new to Knockout.js,
I have created an observable array and initialized with some data. I am expecting any time the UI is changed (check box or text values) the model should also get updated.

I have also subscribed to the array. but my call back method is never called.

var viewModel = {
    seats:ko.observableArray( [
        { "No": "1", "Booked": "" }, ...
    ] )
};

viewModel.seats.subscribe(
    function(newvalue){
        alert(newvalue);
    }
);

ko.applyBindings( viewModel);

http://jsfiddle.net/2NMJX/

  • 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-06T11:47:18+00:00Added an answer on June 6, 2026 at 11:47 am

    You’ve just created an observable array – that means, you get notified whenever the array is updated (an element is added or removed, example: http://jsfiddle.net/2NMJX/1/), but not when the elements themselves are updated. To achieve that, you will need to encapsulate the values in observables:

    seats: ko.observableArray( [
        { "No": ko.observable("1"), ...
    

    Then, you’re able to subscribe to these observables:

    viewModel.seats()[0].No.subscribe( ...
    

    http://jsfiddle.net/2NMJX/2/ (try editing the “1”)

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

Sidebar

Related Questions

I'm new to knockout js and got an observable array, when populating the array
I'm looking for the best way to initialize a knockout observable array from some
I'm a new user to knockout.js and so far have been very impressed with
I am new to KnockOut JS and I cannot find the reason for data-bind
If I have an observable array foos = [{ name: a }, { name:
I'm trying to add a new item to an observable array when a button
All the knockout examples I have found seem to add a new item to
I am new to Knockout Js..I have this issue on my page that when
I have the following issue: I have an observable array of objects in the
New to PHP and MySQL, have heard amazing things about this website from Leo

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.