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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:52:05+00:00 2026-05-26T20:52:05+00:00

I have using jQuery template using jsrender.js & jquery.views.js by http://github.com/BorisMoore/jsviews I have 1

  • 0

I have using jQuery template using jsrender.js & jquery.views.js by http://github.com/BorisMoore/jsviews

I have 1 nested loop and inside teh nested loop i want the get itemNumber or some other value.
Eg:

Template:

{{#each ImageQuestions}}
  <div id="image-{{=$view.itemNumber}}">
  {{#each GroupImagesRepeatation}}
    <input type="radio" name="{{=$view.parent.data.QuestionID}}" value="{{=$view.itemNumber}}" />
  {{/each}}
{{/each}}

Array:

var Questions = {
        ImageQuestions: [
                            { 
                                QuestionID: 1,
                                GroupImagesRepeatation: [1, 2, 3, 4]
                            },
                            {
                                QuestionID: 2,
                                GroupImagesRepeatation: [1, 2, 3, 4, 5, 6]
                            }
                        ]
    };

Query: {{=$view.parent.data.QuestionID}} is what i want to work correctly. I require to give unique name to radioList for each nested loop.

Please assist me.

  • 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-26T20:52:05+00:00Added an answer on May 26, 2026 at 8:52 pm

    The reason {{=$view.parent.data.QuestionID}} is not returning the correct value is because you need to step up through two parent levels: {{=$view.parent.parent.data.QuestionID}}.
    The immediate parent has as data the GroupImagesRepeatation array. Its parent is the data item of the outer each loop – which has a questionID property.

    You can use a more compact syntax:

    {{#each ImageQuestions}}
      <div id="image-{{=$itemNumber}}">
        {{#each GroupImagesRepeatation}}
          <input type="radio" name="{{=$parent.parent.data.QuestionID}}" value="  {{=$itemNumber}}" />
        {{/each}}
    {{/each}}
    

    A tip – for debugging within the compiled template:
    Set $.views.allowCode = true; and then add {{*debugger;}} within the template, e.g. {{*debugger;}}<input type="radio" ....

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

Sidebar

Related Questions

Using JQuery and the Microsoft Template plug-in, I have this in the template: <input
I'm using Chris Richards' Star Rating jQuery Plugin from Github alongwith the jQuery Template
For jQuery template: http://api.jquery.com/category/plugins/templates/ I want to be able to dynamically load the templates
I have a dynamic view created using jQuery template. The UI is basically a
I have been using Jquery alot lately an was wondering if I should use
I have started using jQuery and rails. I have made a simple form that
I'm working on a asp.net mvc2 app. I have been using jquery to do
I have some tabs using jQuery UI which work just fine, but I want
I have problem while using jquery maskedinput with asp.net textbox. I have a check
I have just started using jQuery and although following code gets the job done,

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.