-
Notifications
You must be signed in to change notification settings - Fork 120
Support for filter event (CollectionViewHelper) #351
base: master
Are you sure you want to change the base?
Conversation
…ilter event on a collection to enforce a refilter of a collection bound to a CollectionViewHelper (with an itemFilter). Added handling of the filter event of a collection bound to a CollectionViewHelper
nice one! |
… gets the parameters collection, response and options. The options parameter is not forwarded by thorax. Forward the options parameter to the success handler. http://backbonejs.org/#Collection-fetch
@eastridge weren't we talking about not supporting this at one time in favor of calls on the collection view itself? My concern with this is you are emitting an event on a potentially shared object that may have only changed for one view. |
What about only listening to the event if the collection view has set a filter? For all other instances it's not important anyway. Triggering it on the collection has the benefit, that it's not required to know the CollectionView instance, for example if the collection helper is used... |
That doesn't really impact the overhead, as At a more conceptual level, this event is saying "hey collection, the view changed, you should tell the view that it changed", which feels wrong to me. I've run into a number of scenarios where looking up the |
@kpdecker yes we did talk about that but it was never implemented. This PR makes the code more consistent with the docs but I agree that it's an abuse of what the collection object should be concerned with (using an event on the collection to force something to happen on the view) |
I tested 3.x version with getCollectionViews(collection). |
Micha Reiser seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
According to the documentation (http://thoraxjs.org/api.html) it should be possible to trigger the filter event on a collection to enforce a refilter of a collection bound to a CollectionViewHelper (with an itemFilter).
Added handling of the filter event of a collection bound to a CollectionViewHelper