Comments (4)
Perhaps an extension to the paginated collection would be helpful here: getUnpaginatedLength()
or something along those lines?
from backbone.obscura.
Yep, would totally make sense in my world.
For anyone else stopping by, I'll include the line you posted on Twitter, thanks :)
"proxy._filtered.length" does the trick for now.
from backbone.obscura.
Currently you can access the filtered collection within an obscura collection via _filtered
, so you can still get access to it.
var proxy = new Obscura(collection);
proxy.filterBy({ a: 2 });
proxy.setPerPage(10);
collection.length; // the original collection length
proxy.length; // the paginated length
proxy._filtered.length; // the filtered length
Though I'd want an official API for this. Should be simple to add.
from backbone.obscura.
@marcfalk This should be fixed now :)
var proxy = new Obscura(collection);
proxy.filterBy({ a: 2 });
proxy.setPerPage(10);
collection.length; // the original collection length
proxy.length; // the paginated length
proxy.getFilteredLength(); // the filtered length
from backbone.obscura.
Related Issues (20)
- GroupBy / Filtering out Duplicates HOT 8
- Possible calculation bug on set sort HOT 4
- Model change events causing a remove/add on collection HOT 6
- Model change event not working after filtering HOT 1
- Usage with Marionette: on filtering, renders individual ItemView(s) and not Composite/Collection view HOT 3
- Obscura does not extend Backbone.Collection HOT 7
- Grouping? HOT 2
- filtering nested collection HOT 2
- Add sync events HOT 3
- Proxy Collection retrieved is only of single element HOT 2
- Server pagination HOT 2
- Bower.json version doesn't match package.json version as of 1.0.0 HOT 1
- Complex setSort() callback HOT 3
- 'filtered:add' event is triggered before the collection is filtered HOT 1
- Alphanumeric Sorting HOT 1
- Unnecessary sorting on change between models with same comparators
- Update for Backbone v1.1.0 HOT 1
- Doesn't update when original collection is sorted HOT 1
- Support Multiple Base Collections HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backbone.obscura.