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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:18:16+00:00 2026-05-20T18:18:16+00:00

I have a json object with a few properties in it including a list

  • 0

I have a json object with a few properties in it including a list of another object type. I then bind the main object to a template using the tmpl plugin and I have an {{each}} for the list. Inside that each I want to get at a property of the original object.

example:

new PageItem(
    'Josie',//Name
    816,//ItemID
    0.0000,//Price
    0,//Quantity
    -1,//DiscountPrice
    'Adopt this bilby!',//Content
    ko.observableArray([ //Mods
        new ModItem(
            '1. Bronze $50', //Name
            812, //ItemID
            50.0000, //Price
                -1//DiscountPrice
        ),
        new ModItem(
            '2. Silver $100', //Name
            813, //ItemID
            100.0000, //Price
                -1//DiscountPrice
        )
    )

Template:

{{each Mods}}
    ${Name} - ${parentname?}
{{/each}}

Probably makes it a bit trickier when the objects have the same property names…

  • 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-20T18:18:17+00:00Added an answer on May 20, 2026 at 6:18 pm

    Figured out the answer.
    using $data (which is the object applied to the template) I can then get the Parent properties from the each loop.

    {{each Mods}}
        ${Name} - ${$data.Name}
    {{/each}}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSON object items which has few items that I want to
I have a json object that i send as a template variable to my
So I have a large JSON object i'm returning from the server, then building
Hi I have a JSON object that is a 2-dimentional array and I need
I have created a json object from ruby with cobravsmongoose, however the attributes have
say I have the following json object; {'fname':'john', 'lname':'Locke'} and the following text boxes
I have a request that returns a JSON object with a single property which
I have a JSON array with ActiveRecord objects. These objects can be reconstructed using
I have a class that's currently inheriting from Dictionary and then adds a few
I have a domain object on which I want to store a few things

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.