Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Created June 6, 2014 12:53
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/b26adbaaa14f401e3447 to your computer and use it in GitHub Desktop.
Save kuc-arc-f/b26adbaaa14f401e3447 to your computer and use it in GitHub Desktop.
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