#226 new
Christopher Swasey (endash)

CollectionView improperly prunes old groupViews

Reported by Christopher Swasey (endash) | November 21st, 2008 @ 04:32 AM

Scenario

The groupBy value of a record in a collectionView is changed by a collectionViewDelegate. The record was the last record in its former group.

Expected behaviour

The collectionView redraws to include the record in its new group, and to remove the old group.

Actual behaviour

Varies. The collectionView seems to redraw, but fails to remove the old group, and instead places other records into the old groupView. Actual layout of the individual items seems correct, but the anomalous groupView is rendered on top of the correct groupView.

Cause

When it comes time to remove a groupView, insertViewForItem passes the groupBy value on the record to removeGroupView to use as the hash key (groupValue). If the record has changed groups, this results in the wrong groupView getting looked up from the hash.

Solution

The groupView has its groupValue set as a property on creation. That property should be used for the hash lookup, instead of the property on the record.

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

SproutCore: JavaScript Application Framework

Source available from github
The Git repository resides at http://github.com/sproutit

Check out the current development trunk with:
git clone git://github.com/sproutit/sproutcore.git

Creating a bug report

When creating a bug report, be sure to include as much relevant information as possible. Post the code sample that causes the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.

Submitting Patches

Resist adding new tags, use the ones in the tag cloud already. If you are submitting a patch or a pull request from a fork, tag the ticket as a "patch". If you are submitting a new feature enhancement, tag it as "enhancement". If you are submitting a fix for a bug, tag it as "fix".

Thanks!

We're glad you're contributing. Feel free to drop by the Google Group as well to let us know you are involved.

People watching this ticket

Tags