marionettejs/backbone.marionette — pull request #248 by jonotron (2012-09-19 17:44:23+00:00)
Title: If itemViewOptions is a function, it should be passed the item/model

## Why
Currently there is no way to provide item specific options to the `itemView` instance in a `CollectionView`. For example, if I am using `backbone-relational` (with collections inside models) and I want my `itemView` to be a nested `CollectionView` or `CompositeView` I have no way of instantiating these `itemView`s with the collection related to the model.

## What
My solution is to pass the item `model` into `itemViewOptions` when it is declared as a function.

Currently, the only differentiating thing between `itemView` instances is the `model` itself. Making this item available to the `itemViewOptions` allows the developer to return options specific to that model

## Discussion
In most use cases, the `itemView` can extract anything it needs from the `model` supplied to it, but when options are required at construct time I need a way to supply these specific options (as is the case when I need the `itemView` to be an instance of a `CompositeView` with a supplied collection).