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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:44:30+00:00 2026-06-06T01:44:30+00:00

I am developing a task app in Backbone.js for FUN and one of feature

  • 0

I am developing a task app in Backbone.js for FUN and one of feature is grouped view. Grouped view will display tasks that are grouped according to their done status. Currently i can construct the grouped object from the collection. Constructing the view has become trivial to me. Here is a snapshot of how i want the view to look like

Completed Tasks

- Water the Garden

- Clean my closet

Pending Tasks

- Watch Whose line is it anyway

the JSON after grouping is below

{
    "true": [{
        "Name": "Finished Demo",
        "Done": true,
        "id": "4b3d8d3d-637c-fd5d-034b-b275b5f00e05"
    }, {
        "Name": "This is a new task",
        "Done": true,
        "id": "db5b379f-6f96-346d-4945-baf2d5ac0c76"
    }, {
        "Name": "Clean the closet",
        "Done": true,
        "id": "3b5091e5-a8df-845b-3c6d-2185187eb456"
    }],
    "false": [{
        "Name": "Edited another new task",
        "Done": false,
        "id": "0ee399b2-8fd9-84f2-735e-902d09c625a1"
    }]
}

I can’t think of how to construct a template for the UI based on grouped json above. Assuming i am using underscore.js _.template for templating purpose.

  • How should the template look
  • 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-06T01:44:31+00:00Added an answer on June 6, 2026 at 1:44 am

    Keep in mind, true and false are reserved keywords in Javascript. I suggest you don’t use it as variable names.

    <ul>
        <% if (finished) { %>
            <% _.each(finished, function (task) { %>
                <li id=<%= task.id %>>
                    <%= task.Name %>
                <input type="checkbox" checked />
                </li>
            <% }); %>
        <% }; %>
        <% if (unfinished) { %>
            <% _.each(unfinished, function (task) { %>
                <li id=<%= task.id %>>
                    <%= task.Name %>
                <input type="checkbox" />
                </li>
            <% }); %>
        <% }; %>
    </ul>
    

    http://jsfiddle.net/theotheo/zJXW8/

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

Sidebar

Related Questions

I am developing a task manager application.. In that app, I display to the
I'm developing a Cocoa app that has to execute some terminal commands . One
I'm developing an app that needs background task updating location every 30 mins. I've
In the app that I'm developing, I want to have re-occuring task on each
I'm developing an app where I use performSelectorInBackground to do some sync task in
I'm developing an app that starts with a main menu, and then continues through
I'm developing for Android and I have an app (called Forget-Me-Not) that uses a
I am developing a library that uses one or more helper executable in the
I'm developing an app that handle sets of financial series data (input as csv
While developing, I will sometimes try a technique or method that doesn't pan out

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.