Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplaying collections within collections with Backbone.Marionette
    primarykey
    data
    text
    <p>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.</p> <p>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):</p> <pre><code>+---------+----------------+-----------------------------+ |ISBN |Title |Tags | +=========+================+=============================+ |12345678 |My Last Summer |vacation diary kids | +---------+----------------+-----------------------------+ |12354389 |The Day After |fiction future | +---------+----------------+-----------------------------+ </code></pre> <p>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.</p> <p>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.</p> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload