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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:57:42+00:00 2026-06-14T01:57:42+00:00

I have data I need to display/edit that does not seem to fit naturally

  • 0

I have data I need to display/edit that does not seem to fit naturally with the built-in views that Marionette provides. Let me give an example to illustrate.

Say I want to list/edit books. Each book has one ISBN, one title and 0 or more tags. Basically, the display of the information would be tabular (each word under Tags is a separate tag and could be edited/deleted separately):

+---------+----------------+-----------------------------+
|ISBN     |Title           |Tags                         |
+=========+================+=============================+
|12345678 |My Last Summer  |vacation diary kids          |
+---------+----------------+-----------------------------+
|12354389 |The Day After   |fiction future               |
+---------+----------------+-----------------------------+

If there was only one tag per book, then CompositeView/ItemView would work very nicely. What I am thinking is to create regions dynamically in the last cell of each row and then use CompositeView/ItemView to handle the list of tags. Perhaps this is overkill and having some kind of iterator in the template is the way to go.

I thought about capturing tags and populating a single string with the list of tags for a particular book. I could do that by manipulating the data I receive from the backend and thus making the list of tags into a single data element so that I can use CompositeView/ItemView to deal with with it as a simple table. This does introduce an extra “mapping” and things will get even more complicated to implement the “edit” views.

So I was just hoping to hear if people had bumped into this kind of requirement and what were the approaches that work well with Marionette. Thanks.

  • 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-14T01:57:44+00:00Added an answer on June 14, 2026 at 1:57 am

    There are a number of different ways you could make this work, as you’ve already discovered. Each of the options will be better suited to a specific set of circumstances, but it’s also possible that your circumstances are such that there isn’t a “best” way to accomplish what you want. If that’s the case, just pick one and move on. 🙂

    Map The Tags To A Single Value

    This is what you’ve suggested already. It would work well in situations where the number of tags is relatively small and you don’t need any custom actions taken when someone clicks on a specific tag. For example, if you’re just setting up each tag as an <a href="#{tag-name}"> link, you could easily do this with the tags mapped down to a simple array.

    Iterate The Tag Collection In The Template

    Basically the same as the mapping option, except instead of reducing the tags down to a simple array of strings, you would iterate the tag collection in the template as models, and call model.get(…) in order to get the data you need.

    If you’re using a template engine like Handlebars, this becomes really easy to do and might produce a much more clean result through the use of sub-templates.

    I probably wouldn’t recommend this approach for underscore templates, though, as they tend to get muddy and ugly fast, when doing iteration.

    A CollectionView Of CllectionViews, Using A Layout

    This is the more complex option but also the most capable.

    Configure the itemView for the collection of books as a layout. The layout would have a single region in it, and the region would be populated with another collectionview to render each of the individual tags.

    The benefit here is that you can have a lot more code and functionality associated with your individual tag that is being rendered. You’ll have a single view instance for each tag, which means it will be easier to keep that code encapsulated and organized.

    The drawback is that you’ll have a view instance for every tag, and more code to write just to get this set up and running.

    CollectionView of CompositeViews

    The compositeview lets you render a wrapper template around the collection, which may prove to be an advantage over CollectionView.

    You would need a CollectionView, still. This CollectionView would render a CompositeView as it’s itemView. The CompositeView would specify an itemViewContainer to render the collection of tags. Each tag gets it’s own view instance, still.

    You could get rid of the Layout and region this way. The visual result is the same as using a CollectionView with Layouts, but the amount of code to do it is probably reduced significantly.


    Personally, I would either do the map/reduce to get the tags down to a simple array, or use a CollectionView Of CompositeViews.

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

Sidebar

Related Questions

I need to be able to display data that I have in 15 minute
I have some hierarchical data that I need to display in a series of
I have 1000 rows of data but need to only display 100 rows at
We have a situation where we need to display data from a database in
I have data from two different sources that I need to combine. Some data
I have a QTableWidget that is used to display lots of data, basically derived
i'm currently working a list of data that i need to display in a
I have some data and need to create a json file with this structure
I have some data which i need to make some statistics. I need to
I need to have data structure, each element in which is accessible by pair

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.