Skip to content
This repository has been archived by the owner on May 17, 2018. It is now read-only.

Next row is added at the wrong postion in a pageable collection when deleting a row in the view #118

Closed
jurgenkalverboer opened this issue Oct 17, 2013 · 9 comments
Labels

Comments

@jurgenkalverboer
Copy link

When I remove the highlighted row in the image below.

backgridremoverowbefore

The next row in the collection should be added at the bottom of the pageable collection. However it is inserted one position too high.
backgridremoverowafter

On the pageable collection I call the function remove with the corresponding model as its parameter. In backbone-pageable.js the collectionEventHandler is triggered by this action (with a "remove" event). Line 453 of this file will add a new row to the page collection:

if (nextModel = fullCol.at(pageEnd)) pageCol.push(nextModel);

This function will call the function inserRow immediatly on the pageable collection (in backgrid,js), this thus happens before the remove event will call the function removeRow. The index that is determined by the insertRow function is thus not correct:

var index = collection.indexOf(model);

@excentris
Copy link

+1

6 similar comments
@oosterholt
Copy link

+1

@ericbeijer
Copy link

+1

@KramerCJ
Copy link

+1

@WRidder
Copy link

WRidder commented Oct 17, 2013

+1

@Wietjerr
Copy link

+1

@beatle01
Copy link

+1

@wyuenho
Copy link
Member

wyuenho commented Nov 2, 2013

Let me know if b2a1aa1 fixes this issue. I'll commit a test soon.

@wyuenho
Copy link
Member

wyuenho commented Nov 2, 2013

Actually forget that. It doesn't. Let me fix this in a moment.

@wyuenho wyuenho closed this as completed in 2f46527 Nov 2, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants