title: How do I update data in indexedDB?
body: <p>I have tried to get some information from <a href="http://www.w3.org/TR/IndexedDB/" rel="noreferrer">W3C</a> regarding the update of an objectStore item in a indexedDB database, but with not so much susccess.
  I found <a href="http://dominoc925.blogspot.ro/2012/06/use-html5-indexeddb-cursors-to-update.html" rel="noreferrer">here</a> a way to do it, but it doesn't really work for me.</p>
  
  <p>My implementation is something like this</p>
  
  <pre><code>DBM.activitati.edit = function(id, obj, callback){
      var transaction = DBM.db.transaction(["activitati"], IDBTransaction.READ_WRITE);
      var objectStore = transaction.objectStore("activitati");
      var keyRange = IDBKeyRange.only(id);
  
      objCursor = objectStore.openCursor(keyRange);
      objCursor.onsuccess = function(e){
          var cursor = e.target.result;
          console.log(obj);
          var request = cursor.update(obj);
          request.onsuccess = function(){
              callback();
          }
          request.onerror = function(e){
              conosole.log("DBM.activitati.edit -&gt; error " + e);
          }
  
      }   
      objCursor.onerror = function(e){
          conosole.log("DBM.activitati.edit -&gt; error " + e);
      }                   
  }
  </code></pre>
  
  <p>I have all DBM.activitati.(add | remove | getAll | getById | getByIndex) methods working, but I can not resolve this.</p>
  
  <p>If you know how I can manage it, please, do tell!</p>
  
  <p>Thank you!</p>