Skip to content
This repository was archived by the owner on May 17, 2018. It is now read-only.
This repository was 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

@jurgenkalverboer

Description

@jurgenkalverboer

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions