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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:42:26+00:00 2026-06-18T23:42:26+00:00

i have template (an html file) with is getting renders with JSON data using

  • 0

i have template (an html file) with is getting renders with JSON data using JSRender.

My Sample Template is as follows

<ul id="membersList">
  {{for UserConnection}}
        <li>
        <div>
            <a title="{{:Fullname}}">
            <br />
            <img src="sample.png"/><br />
            {{:Fullname}}</a>
        </div>
        </li>
    {{/for}}

My Json data is

[
{
    "ApplicationName": "appone", 
    "Title": "Title one", 
    " UserConnection ": [
        {
            "Id": 210, 
            " email ": " abc1@xyz.com ", 
        }, 
        {
            "Id": 0, 
            " email ": " ", 
        },
        {
            "Id": 211, 
            " email ": " abc2@xyz.com ", 
        }
    ]
}

];

Now my requirement is the i should hide of div if in particular the 2nd item of
the JSON has the its id value as 0.

Is it possibel in JSRender to check some thing which we do in c# like

for (i = 0 ; i < 10 ; i++)
{
  if (userConnection[i] = 0)
      // show the div
  else 
     // dont show

}

i.e. if i can access UserConnection[i] even in JSRender, then i can show or hide the div.
Is it possible?

  • 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-18T23:42:27+00:00Added an answer on June 18, 2026 at 11:42 pm

    You can look at this example to see how to get to the parent data https://www.jsviews.com/#parentdata

    and there is #index while in the for loop to get access to the current index.

    I think really the answer to your question is to use a helper to construct the div with either display on or off at the time it is created.

    A helper, converter, and customer tags are all general javascript functions that you register and then use.

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

Sidebar

Related Questions

Absolute beginner question: I have a template file index.html that looks like this: ...
I have javascript code embedded inside a html template file. When I load this
I have a template in joomla without index.php I only have index.html, css file,
I have a base.html template that contains a list of links. Example: <div id=sidebar1>
is there any way to have an html file (i.e. an html template) be
Help, I have a problem in getting the html contents of my file if
I have he following scenario: Got an HTML template file that will be used
i have template base.html and some children templates. I don't know how to set
I have the following razor template html, although I can't figure out how to
I have a 'template' system in my CMS rails app. Basically the whole HTML

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.