projecttacoma/bonnie — pull request #39 by carpeliam (2013-12-31 17:12:12+00:00)
Title: Sort data criteria by start date/end date, re-sort on close

Adds a comparator to the Patient Data Criteria. When closing a data criteria, the model triggers a "close" event, which the parent view listens to and re-sorts the collection, triggering a re-render of the criteria in order.

Re-rendering the criteria means that all criteria get rendered in their closed state; if we want more than one to be able to be open at a time, we'd have to maintain state in the view and render accordingly. Not too hard to do, but it would add complexity. We've also talked about displaying the criteria accordion style, where opening one closes any others that were open.

The code so far is relatively simple, so I thought I'd get it up here and we can discuss how we want it to work.