Last active
August 29, 2015 14:02
-
-
Save kuc-arc-f/faa351f48162d7fd227c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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