Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSelectedModels() should only return instances of Backbone.Model #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

prg
Copy link

@prg prg commented Mar 15, 2018

This should alleviate some of the problems people are seeing (e.g. #3, #13, #14). Haven't gone through these issues in detail, but it works for my use case (a grid with server-side paging via Backbone.PageableCollection):

  • "checked"-state is maintained across page switches
  • but getSelectedModels() returns only selected models from the current page

prg added 2 commits March 15, 2018 12:35
- without this, getSelectedModels() return value would sometimes
  contain 'undefined' values; e.g. with server-side paging
- event handlers for "backgrid:selected" are sometimes called in
  the wrong order; e.g. checking the select box in a newly added row
  calls the custom handler first, before the selection is
  updated, which in turn breaks getSelectedModels().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant