Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cells not removed on reloadData when decreasing item quantity #77

Open
jfmorin opened this Issue · 2 comments

3 participants

@jfmorin

When setNeedsLayout is called the following call to reloadData will fail to remove extra cells if the item quantity has decreased (ex: by changing item quantity from 3 to 1).

Calls:
1. layoutSubviews
2. layoutSubviewsWithAnimation:
3. loadRequiredItems
4. setSubviewsCacheAsInvalid is called before multiple calls to cellForItemAtIndex:
5. calls to cellForItemAtIndex: will call itemSubviews

The first call to itemSubviews will set _itemsSubviewsCacheIsValid to YES but other subviews are added. This will cause the next call to realodData to remove only the first cell from the superview rather than all of them.

This can be fixed by adding "[self setSubviewsCacheAsInvalid];" at the end of the loadRequiredItems method.

Great control! I really enjoy using it.
Jeff

@gmoledina
Owner

Good catch ! Thanks @jfmorin.
I'll add this in the code and close the issue once I push the changes (this weekend).

@Krys90

sorry,
when I try to reload a grid, it disappears and does not show the grid with new data.
I tried all methods
also [reloadData]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.