superfeedr / indexeddb-backbonejs-adapter

An indexedDB adapter for Backbonejs
http://blog.superfeedr.com/indexeddb-backbonejs-adapter/
MIT License
248 stars 61 forks source link

fetch with options #20

Closed Balordo closed 12 years ago

Balordo commented 12 years ago

Hi i'm writing a small offline app for chrome using backbone, jquery and indexedDb, i'm also using backbone-indexedDb.js. My app make a request to twitter server asking for a json that contains a certain number of tweets from a chosen user. I get this json and i persist it to my indexexd DB. so i can manage and view tweets offline. I've two models: user and tweet, and two relative collection: users and tweets. somewhere in my code i want to fetch data from the Db that match a condition :

// i get an user id from a link

var userID = $(event.target).attr("id_utente");

// i want to populate a tweets collection with data that satisfy the condition id (user from tweet) = //userID(from link clicked)

twtList.fetch({ conditions: {id: userID} };

it doesn't work for me, the collection is populated with all data in Db (the condition isn't checked). So i made a mistake somewhere or there is a problem with fetch with options?

superfeedr commented 12 years ago

Hum/ Not sure what you're doing wrong, but things are working for us at this point. The first thing you should do is run the tests in your browser. If you get errors, then, the browser is probably the issue. If you don't, then your code is the culprit.

Thanks,