W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2012

[Bug 18809] New: Some examples in the index section (3.3.4) have errors

From: <bugzilla@jessica.w3.org>
Date: Sun, 09 Sep 2012 10:37:54 +0000
To: public-webapps@w3.org
Message-ID: <bug-18809-2927@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18809

           Summary: Some examples in the index section (3.3.4) have errors
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P4
         Component: Indexed Database API
        AssignedTo: dave.null@w3.org
        ReportedBy: art.barstow@nokia.com
         QAContact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-webapps@w3.org


The following email reported errors in the examples in the "index" section
(3.3.4):

[[
http://lists.w3.org/Archives/Public/public-webapps/2012JulSep/0672.html

As far as I can tell, there is no "openIndex" method as shown in the "var
index" example below.  I think it should be objectStore.index() ?  Also, I am
assuming that the var vtx is a versionchange transaction object, but vtx is not
defined anywhere else in the documentation.  Just figured I would pass these
along :)   

3.3.4 Index

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});
});

var index = store.openIndex('ContactName');
var id = index.get('Lincoln');
// id === 1
]]

-- 
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 Sunday, 9 September 2012 10:37:56 GMT

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