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
a trouble about the fetch function #142
Comments
What's that Can you add tests to this project to show me how this is failing? |
Here is the full source of one test. <body>
<script src="js/vendor/jquery-1.11.0.min.js"></script>
<script src="js/vendor/underscore.js"></script>
<script src="js/vendor/backbone.js"></script>
<script src="js/vendor/backbone.localStorage.js"></script>
<script>
var TestModel = Backbone.Model.extend({
defaults: {
field: ''
},
localStorage: new Backbone.LocalStorage('tests-backbone')
});
var TestCollection = Backbone.Collection.extend({
model: TestModel,
localStorage: new Backbone.LocalStorage('tests-backbone')
});
window.localStorage.clear();
var collection = new TestCollection();
collection.create({field: '1'});
collection.fetch();
if (collection.size() > 0) {
collection.invoke('destroy');
alert('data found');
}
else {
alert('data not found');
}
</script>
</body> It shows me 'data not found' in the real chrome browser, var TestModel = Backbone.Model.extend({
defaults: {
field: ''
},
var TestModel = Backbone.Model.extend({
defaults: {
field: ''
}//,
// localStorage: new Backbone.LocalStorage('tests-backbone')
});
}); It runs without any problems. |
I'm inclined to think that this is correct behaviour - |
Hi! Thank you for reading my problem about Backbone.localStorage.
I'm sorry to tell that may be I had found a bug.
I'm not sure if it is a bug or not, but I have a problem like this:
The step is that:
As you see, the record won't be found in the second time if I delete records before and do not specify an id and the id is generated by the localStorage.guid() function.
How can I solve the problem? Do I have to specify one id?
The text was updated successfully, but these errors were encountered: