axemclion / jquery-indexeddb

An IndexedDB Plugin for Jquery.
Other
195 stars 71 forks source link

Can't use double keyPaths in IE 10/11 #62

Closed mcfarljw closed 10 years ago

mcfarljw commented 10 years ago

When I use the following it works in Chrome and Firefox, but cases issues in the latest version of IE.

transaction.createObjectStore('products', {keyPath: ['name', 'revision']});

First it throws a "DataError" at: https://github.com/axemclion/jquery-indexeddb/blob/ed5507cd49ee93fbdec449341306b81507db8f41/dist/jquery.indexeddb.js#L134

Followed by "Assignment to read-only properties is not allowed in strict mode" at: https://github.com/axemclion/jquery-indexeddb/blob/ed5507cd49ee93fbdec449341306b81507db8f41/dist/jquery.indexeddb.js#L90

When I dumb down the keyPaths two a sing single rathe than array it appears to work. Any thoughts on why this might be happening only in IE?

vijaycnarayan commented 10 years ago

Currently this is not supported in IE10 and IE 11. As a workaround you can stringify and use that as a key.

Please read the below threads for more information:

http://stackoverflow.com/questions/14283257/indexeddb-compound-key-ie10

http://social.msdn.microsoft.com/Forums/windowsapps/en-US/dbf2fd2d-a8ca-4228-8a49-3948d44f7e26/indexeddb-and-complex-keypaths-for-index?forum=winappswithhtml5

mcfarljw commented 10 years ago

I was afraid of that. I ended up just combined the two keys into a string, but either or it's not a jquery-indexeddb issue.