emberjs/list-view — pull request #177 by mysterlune (2014-12-01 23:00:39+00:00)
Title: Update cached heights and `totalHeight`, etc., when item view heights vary, or are dynamic

This PR handles the situation in which individual row heights for item views change or have dynamic elements within them (e.g. text fields, accordion-ish views, etc.)

The introduction of the list view's `...heightForIndex(idx)` and related methods/properties that enable individual heights per item view is really a huge addition. I hit a case in my own project where I don't actually know the appropriate height for items (images) until after the views all render and the service responds with data. Using the `heightForIndex` callback, it's simple to feed the correct heights to the list view. However, the cached heights (from the initial render of the list) does not update. Also, the list's `totalHeight` and the `position.y`s of all the items remain what they originally were set to on initial render.

This PR adds a cache-busting routine that ensures `_cachedHeights` recomputes when item view heights change dynamically. Also, in the event of such a change, the `totalHeight` will recompute as well.

This PR also (I think) introduces the concept of a `rowHeight` property for `Ember.ListItemView` and subclasses.