I'm using Backbone.Marionette and need to render a view of employees and their respective departments. I want it to look something like so:
Department 1
***
Employee1
Employee2
Employee3
Department 2
***
Employee4
Employee5
Employee6
Employee7
Employee8
Department 3
***
Employee9
Employee10
My collection looks like this:
Employee1 / Department1
Employee2 / Department1
Employee3 / Department1
Employee4 / Department2
Employee5 / Department2
etc.
As the department
changes I need to render the department
heading.
Which combination of view types would I use. Collection view
, Composite view
. Would I need to put logic in the view/template?