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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:37:02+00:00 2026-06-15T08:37:02+00:00

Fiddle can be found here . I’m adding to an observable array which is

  • 0

Fiddle can be found here.

I’m adding to an observable array which is mapped by ko.mapping.fromJS().

In my view I’m building a URL by using a property on the array attr: { href: '/Users/Summary?userId=' + ID() }.

If I want to add an item to the array I’m using self.Users.push().

If I do that I get an error of ID is not a function.

So my question is whats the correct way of adding an item to the array, or am I not building the href attr properly?

  • 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-15T08:37:03+00:00Added an answer on June 15, 2026 at 8:37 am

    It seems like you are trying to push a plain object (without observables). You need first construct it, or map it to obsevables.

    self.Users.push(new User(data));
    

    or

    self.Users.push(ko.mapping.fromJS(data, mapping));
    

    Another alternative would be to just remove the () from the expression. But then the observable ID-properties will behave strangly.

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

Sidebar

Related Questions

I am sorting a table. The fiddle can be found here . CREATE TABLE
Here is the FIDDLE you can fork and work on Given a list of
Here's my fiddle: http://jsfiddle.net/e6kCH/15/ It may sound stupid, but I can't find a way
I recently found a problem, which can add to technology of calender A user
I found a javascript snow script. Here is the fiddle: http://jsfiddle.net/wj2K4/ (very nice) Its
This isn't a javascript question but I've created a fiddle so I can demonstrate
I have a requirement where I can use JS Fiddle dropdown to populate States
Referencing this Fiddle ( http://jsfiddle.net/j5uGN ), how can I toggle a clicked image's border
fiddle is here . I am having trouble grabbing the actual column by the
Fiddle is here - http://jsfiddle.net/ashwyn/a45ha/ HTML here - <div class=parent> <div class=a>Class A</div> <div

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.