Comments (6)
Looks good! I'd be happy to merge that if you make a PR.
In what situation could this.models[idx].off
not be a function?
from backbone.virtualcollection.
I had the _rebuildIndex problem on Chrome too. It's because the idx in for (idx in this.models) can be a 'last' and this.models['last'] is a method which doesn't have 'off'. I got it working by switching to a forEach and checking for this.models existence .
from backbone.virtualcollection.
What? I don't understand what you're describing.
for (i in [1, 2, 3]) {
console.log(i);
}
how is i
ever "last"
?
from backbone.virtualcollection.
Hm. When I do it in the console it doesn't do last but when I do it running the app I'm using Virtual Collection i do get 'last'
for(idx in [1,2,3]) { console.log(idx) }
VM537:2 0
VM537:2 1
VM537:2 2
VM537:2 last
undefined
Might have stuff to do with with the shims we're using.
from backbone.virtualcollection.
that's definitely not normal javascript behaviour... and not an issue VirtualCollection should deal with.
from backbone.virtualcollection.
for-in
will loop through items in the prototype too. Normally you should use hasOwnProperty()
to prevent this behaviour.
I've fixed this in #67 by using _.invoke
instead.
from backbone.virtualcollection.
Related Issues (20)
- Not compatible with 0.9.2 HOT 1
- NPM is not up to date HOT 2
- Change event triggered without options.index causes error HOT 1
- Source Missing License Header HOT 2
- Listen to a specific attribute changes in a model in a virtual collection
- Publish 0.5.2 to NPM HOT 2
- Create a virtual collection from multiple collections HOT 3
- Support Backbone.PageableCollection HOT 4
- Caching, disabling and re-enabling subsets HOT 2
- Models added twice to a virtual collection HOT 7
- Properly override clone HOT 5
- Problem with Sort when not overridden HOT 7
- Backbone update event not being handled HOT 5
- Add a License and Re-Publish to NPM HOT 1
- Garbage Collection HOT 5
- Option for creating deaf collections HOT 2
- Event "change:attr" is not handled in some cases HOT 6
- make backbone a peer dependency HOT 2
- Adding items to a sorted virtual collection does not trigger sort event HOT 5
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.virtualcollection.