Skip to content

Commit

Permalink
Updated to Ext 4.1 and fixed the bug with some versions of Chrome tha…
Browse files Browse the repository at this point in the history
…t don't play nice with autoIncrement
  • Loading branch information
grgur committed May 13, 2012
1 parent 9e2ded4 commit fe0e6c6
Show file tree
Hide file tree
Showing 5 changed files with 282 additions and 238 deletions.
19 changes: 11 additions & 8 deletions Ext.data.proxy.BrowserDB.js
Expand Up @@ -4,30 +4,33 @@
* BrowserDB Proxy for Ext JS 4 uses best available browser (local) database to use for your locally stored data * BrowserDB Proxy for Ext JS 4 uses best available browser (local) database to use for your locally stored data
* Currently available: IndexedDB and WebSQL DB * Currently available: IndexedDB and WebSQL DB
* *
* Version: 0.21 * Version: 0.3
* *
*/ */
(function() { (function() {

var idb = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB, var idb = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB,
cfg = {}; cfg = {};


/** /**
* Choose which proxy to extend based on available features. IndexedDB is preferred over Web SQL DB * Choose which proxy to extend based on available features. IndexedDB is preferred over Web SQL DB
*/ */
if (!idb) { if (!idb) {
cfg.extend = 'Ext.data.proxy.WebDB'; cfg.extend = 'Ext.data.proxy.WebDB';
cfg.dbInUse = 'webdb'; cfg.dbInUse = 'webdb';
} else { } else {
cfg.extend = 'Ext.data.proxy.IndexedDB'; cfg.extend = 'Ext.data.proxy.IndexedDB';
cfg.dbInUse = 'idb'; cfg.dbInUse = 'idb';
} }


Ext.define('Ext.data.proxy.BrowserDB', { Ext.define('Ext.data.proxy.BrowserDB', {
extend: cfg.extend, extend : cfg.extend,
alias : 'proxy.browserdb',
alternateClassName: 'Ext.data.proxy.BrowserCache',


dbInUse: cfg.dbInUse, alias : 'proxy.browserdb',

alternateClassName : 'Ext.data.proxy.BrowserCache',

dbInUse : cfg.dbInUse,


/** /**
* Route to the right proxy. * Route to the right proxy.
Expand All @@ -44,4 +47,4 @@
} }
}); });


})(); }());

0 comments on commit fe0e6c6

Please sign in to comment.