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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:15:01+00:00 2026-05-28T11:15:01+00:00

I am constructing a task app ( For fun) & i just sat down

  • 0

I am constructing a task app ( For fun) & i just sat down thinking about this problem. I will put the question on my mind in words here.

Model is extremely simple, it contains collection of Project. Each Project contains a TaskList these TaskList is nestable i.e for example a Task Design FrontPage can have Design Header as another TaskList. Each TaskList contain Tasks. How will a typical javascript template look like for this problem. I could not come with one that works this scenario. This problem is as same as N level nested Menu, how would you render it using templating library.

<div>
    {{#Projects}}
    <div>
        <b>{{ProjectName}}</b>
    </div>
    <ul>
        {{#TaskList}}
        <li>{{TaskListName}} {{CreatedBy}} The Problem Comes here - How do i Render a #TaskList
            here </li>
        {{/TaskList}}
    </ul>
    {{/Projects}}
</div>

btw if anyone has asp.net solution (Ideas for this let me hear them), N level deep nesting is the thing i am unable to overcome right now.

  • 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-28T11:15:01+00:00Added an answer on May 28, 2026 at 11:15 am

    You could define your TaskList as a partial and include it recursively as the documentation hints.

    Templates:

    <script type="text/template" id="projects">
        {{#Projects}}
        <div>
            Project: <b>{{ProjectName}}</b>
        </div>
        {{>taskList}}
        {{/Projects}}
    </script>
    
    <script type="text/template" id="task-list">
        {{#TaskList}}
        <ul>
            <li>
                {{TaskListName}} <em>{{CreatedBy}}</em> 
                {{>taskList}}
            </li>
        </ul>
        {{/TaskList}}
    </script>
    

    JavaScript:

        var data = {
        Projects: [
            {
            ProjectName: "Project 1",
            TaskList: [{
                TaskListName: "Name 1",
                CreatedBy: "Person 1"},
            {
                TaskListName: "Name 2",
                CreatedBy: "Person 2",
                TaskList: [{
                    TaskListName: "Sub Name",
                    CreatedBy: "Same Person"},
                {
                    TaskListName: "Sub Name 2",
                    CreatedBy: "Person 1"},
                {
                    TaskListName: "Sub Name 3",
                    CreatedBy: "Person 3-2",
                    TaskList: [{
                        TaskListName: "Sub Sub Name",
                        CreatedBy: "Person 3-3"}]}]}]},
        {
            ProjectName: "Project 2",
            TaskList: [{
                TaskListName: "Name 3",
                CreatedBy: "Person 3"},
            {
                TaskListName: "Name 4",
                CreatedBy: "Person 4"}]}]
    },
        template = $('#projects').html(),
        partials = {
            taskList: $('#task-list').html()
        },
        html = Mustache.render(template, data, partials);
    
    document.write(html);
    

    Here’s the jsFiddle to see it in action- http://jsfiddle.net/maxbeatty/ND7xv/

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

Sidebar

Related Questions

Hey, I'm thinking about using griffon in an very simple DeskTop app I've been
We are constructing an application that will be interacting with Exchange 2007 calendar functions.
Since I'm beginner in J I've decided to solve a simple task using this
Ok, I asked this question before, but deleted it as the way I went
Please consider a problem constructing an array and returning it to a parent object.
Im constructing an array of objects like this: var postData = []; $.each(selectedFields, function
I've been having this problem for a long time now and I cannot solve
Constructing an OpenId provider, I've run into the curious problem that only Stack Exchange
In a WPF app I have a sheduled database access task, periodically run by
A previously-working Rails 3.1 app is now failing to deploy. The Capistrano deploy:assets:precompile task

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.