Closed jefersondaniel closed 10 years ago
This would be a situation to roll your own implementation. Collection bindings are really hard to automate efficiently, simply because a collection has so many events, each of which can potentially trigger at a high magnitude (ie: across N models). Epoxy is deliberately conservative about binding to collections for this reason. You're a lot better judge of what triggers your application needs, and how best to hook into them as efficiently as possible.
For anybody who might stumble upon this lateron: see #25 regarding recomputing of computeds based on collections.
Also see http://epoxyjs.org/documentation.html#handler-collection
Note that the collection binding does not register a "change" event on its collection to avoid generally superfluous updates. Instead, you may manually trigger an "update" event on the collection to refresh its bindings. For a working demonstration of the collection binding, see the Epoxy ToDos demo.
I have a code following that example and want to listen to collection changes and recompute the charged amount:
But it does not work. What are the alternatives?