Created
June 6, 2014 12:53
-
-
Save kuc-arc-f/b26adbaaa14f401e3447 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.proc_addItem = function(item ,view) | |
{ | |
var rq = indexedDB.open(DB_NAME); | |
rq.onsuccess = function(e) { | |
console.log('#onsuccess_open'); | |
var db= e.target.result; | |
var tx = db.transaction(STORE_NAME, 'readwrite'); | |
tx.oncomplete = function() { }; | |
var store = tx.objectStore(STORE_NAME); | |
var request =store.put({ | |
id : parseInt(item.id ), | |
name : item.name, | |
nameKana: item.kana | |
}); | |
request.onsuccess = function(e) { | |
console.log('#onsuccess_add'); | |
db.close(); | |
proc_addComplete(view); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment