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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:01:43+00:00 2026-06-12T07:01:43+00:00

Im trying to access information from two different arrays within my viewModel with two

  • 0

Im trying to access information from two different arrays within my viewModel with two foreach loops, but the items are not nested within each other

<tbody data-bind="foreach: runnr">
    <tr>
        ......
        <!--ko foreach: $root.options -->
        <td data-bind="visible: value"><span data-bind="text: runnr[prop] "></span></td>
        <!-- /ko -->

I want ‘visible’ to be set to the options value property, but the span text I want set to a property from runnr based on the prop from options.

options = ko.observableArray([
  { name: "PP", value: pp, prop: 'Post' },
  { name: "Weight", value: weight, prop: 'Weight' },
  { name: "Price", value: price, prop: "Price" }]);

runnr = ko.observableArray([
    {Post:1, Weight:125, Price:12000},
    {Post:2, Weight:124, Price:15000}
]);
  • 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-12T07:01:44+00:00Added an answer on June 12, 2026 at 7:01 am

    You should be able to use $parent[prop] to access the runnr that you are looping over.

    Simplified fiddle: http://jsfiddle.net/rniemeyer/y3R43/

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

Sidebar

Related Questions

I am trying to access information from an Oracle meta-data table from within a
I'm trying to access basic information from a FRIEND page via FQL: SELECT name,
i am trying to access some information from a running Microsoft Word application using
I'm trying to access information on a web browser from another thread. When trying
I'm trying to hide Revision information from my users who do not understand what
I am trying to access information on a website that uses frames. When I
Trying to access a Servlet from a button on HTML page //Html Page FORM
I am trying to access all the data from database listOfFolder table folder and
Ok, so I am trying to extract the information from a cache.dat database sent
I'm trying to use the Task-Parallel-Library to offload expensive ADO.NET database access from the

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.