W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

[Bug 16133] [IndexedDB] update createObjectStore examples to use optionalParameters

From: <bugzilla@jessica.w3.org>
Date: Fri, 09 Mar 2012 20:52:41 +0000
To: public-webapps@w3.org
Message-Id: <E1S66np-0007Oc-4L@jessica.w3.org>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16133

Eliot Graff <eliotgra@microsoft.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |eliotgra@microsoft.com
         Resolution|                            |FIXED

--- Comment #1 from Eliot Graff <eliotgra@microsoft.com> 2012-03-09 20:52:40 UTC ---
The samples have been updated as follows:

Section 3.3.3 (First Sample)
OLD
var db = indexedDBSync.open('AddressBook', 1, function(trans, oldVersion) {
  trans.db.createObjectStore('Contact', 'id', true);
});
NEW
var db = indexedDBSync.open('AddressBook', 1, function(trans, oldVersion) {
  trans.db.createObjectStore('Contact', {keyPath:'id', autoIncrement:true} );
});

Section 3.3.4 (First Sample)
OLD
var db = indexedDBSync.open('AddressBook', 2, function(trans, oldVersion) {
  if (oldVersion === 1) {
    trans.db.createObjectStore('Contact', 'id', true);
  }
  var store = vtx.objectStore('Contact');
  store.createIndex('ContactName', 'name', false);
});
NEW
var db = indexedDBSync.open('AddressBook', 2, function(trans, oldVersion) {
  if (oldVersion === 1) {
    trans.db.createObjectStore('Contact', {keyPath:'id', autoIncrement:true});
  }
  var store = vtx.objectStore('Contact');
  store.createIndex('ContactName', {unique:false, multiEntry:false});
});



Thanks!
Eliot

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Friday, 9 March 2012 20:52:43 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:50 GMT