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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:52:19+00:00 2026-05-30T01:52:19+00:00

Let’s say, I have a backbone.js model named Item that is stored in an

  • 0

Let’s say, I have a backbone.js model named Item that is stored in an ItemCollection. Given that Item has an attribute date, what would be the best approach to partition ItemCollection so that all items sharing the same date end up in the same partition?

Ultimately, the partitioned data structure is supposed back a (backbone.js) view that is supposed to render the items grouped by date.

What would be the best approach for this?

So far I considered

  1. dynamically extracting the partitions when the index view is rendered, but that would probably break the elegance of backbone’s event-based mechanism to render collection / model updates.

  2. representing each grouping header as an instance of a Header model and attaching a collection with its partition to it. I would somehow need to keep the partitions attached to the Header instances in sync with the main ItemCollection, but that’s probably manageable through backbone’s eventing mechanism.

Would any of these approaches make sense? Any other ideas?

P.S.: The grouping structure does not exist in my backend data model (and I would like to avoid introducing it), so this is some mapping that needs to happen on the fly on the client side

  • 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-30T01:52:19+00:00Added an answer on May 30, 2026 at 1:52 am

    It seems like a hybrid of your two options would be workable. I would probably approach this as follows:

    1. Instead of Header, you can have an ItemGroup model (a little more descriptive) that renders the Items inside of its collection, which would be a partition of the larger ItemCollection.
    2. The partitioning itself can be done when you render the parent view, which I’ll call AppView. In AppView#render, partition the data as you want. (You didn’t explicitly ask how to partition the data, but you can use Underscore to do that in a few lines of code.)
    3. Bind AppView#render to the add and remove event of ItemCollection, so that whenever a new item is added, the partitions re-render themselves.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a structure named vertex with a method that adds two
Let's say that I have a date in R and it's formatted as follows.
Let's say that you have a stick figure. Let's say the stick figure has
Let's say I have multiple requirements for a password. The first is that the
Let's say I have a due date and a reminder timespan . How do
Let's say you have a method that expects a numerical value as an argument.
Let's say I have a bunch of links that share a click event: <a
Let's suppose I have a Discussion model, and that a discussion can be tagged.
Let's say that I have a set of relations that looks like this: relations
Let's say I have two assemblies: BusinessLogic and Web. BusinessLogic has an application setting

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.