Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuc-arc-f/faa351f48162d7fd227c to your computer and use it in GitHub Desktop.
Save kuc-arc-f/faa351f48162d7fd227c to your computer and use it in GitHub Desktop.
DbHelper.prototype.get_allItems = function(view)
{
var rqOpen = indexedDB.open(DB_NAME);
rqOpen.onsuccess = function(e) {
var db= e.target.result;
var tx = db.transaction(STORE_NAME, 'readonly' );
var store = tx.objectStore(STORE_NAME);
var rq = store.openCursor();
rq.onsuccess = function(e) {
cursor = rq.result;
if(cursor) {
var item= new Item();
var data = cursor.value;
item.id =data.id;
item.name = data.name;
item.nameKana=data.nameKana;
view.disp_line(item);
cursor.continue();
}
db.close();
};
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment