Skip to content
This repository has been archived by the owner on Jul 4, 2021. It is now read-only.

Can't use collection.reset to use filtered data? #307

Open
suederade opened this issue Dec 2, 2015 · 2 comments
Open

Can't use collection.reset to use filtered data? #307

suederade opened this issue Dec 2, 2015 · 2 comments

Comments

@suederade
Copy link

Trying to filter collections and using reset makes the collection lose all it's paginating abilities. If I instead just replace the namespace's collection with a brand new collection, this.collection.get no longer works with an idAttribute set on the model.

@wyuenho
Copy link
Member

wyuenho commented Jan 15, 2016

I'm not sure what you mean by this. Is this just your application's problem or backbone.paginator's problem? If it is, can you give me the steps to reproduce the issue?

@belackriv
Copy link

Old Issue, I know, but maybe this helps someone. I am using the reset to "filter" models from the main collection with client mode. This is what worked for me:

pageableCollection.reset(filteredmodels);
pageableCollection.state.totalRecords = filteredmodels.length;
pageableCollection.getFirstPage(); 

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants