walmartlabs / thorax

Strengthening your Backbone
http://thoraxjs.org/
Other
1.32k stars 129 forks source link

CollectionView itemFilter doesn't work when itemView is used #412

Closed liorcode closed 9 years ago

liorcode commented 9 years ago

Following #306: now when you use itemFilter along with an itemView, the filter doesn't work. This is because of the following new condition in applyItemVisiblityFilter:

parentCid = $el.view({cid: true});
if (view.cid === parentCid) {
    $el.toggle(show);
}

When itemView is used, this condition will never happen, becausee $el.view is not the parent. This is because of the way $el.view works: it finds the closest element to the el which has a view. But when itemView is used - the closest element is always the item itself - not the parent.