I use localStorage to save the app data of my Backbone app. In my router, I use this.collection.fetch()
to get the data from localStorage and render them. But this.collection.fetch()
actually will fetch all the data in my localStorage space and render them all in View. What I want to do is to get the localStorage data first and filter them, then use these filtered part to render the View. Is it possibile to do this?
相关问题
- Backbone.js PushState routes .htaccess only workin
- Updating a LayoutView's Model
- Disable Backbone.js hashes entirely, but keep push
- DOMException: Failed to read the 'localStorage
- How To Use LocalStorage with MSAL.js
相关文章
- Get all models in backbone collection where attrib
- localStorage data persistence
- PhoneGap iOS 7 and localStorage
- How can I dynamically set a className for a Backbo
- Where is google chrome local storage saved?
- Access web storage from server side - possible?
- Nesting Views within Views in backbone js
- Deleting localStorage data
It's because you probably
bind
the view to thereset
event of the collection.If you want to take more control against what to render (manual rendering not binded to events), you should avoid binding that events and call
render
method when you need it after doing proper filtering of collection.