If you want to see the pictures of my dog, click here. If you want to see what's on my mind, click here.
grgur / ext.data.proxy.websql Goto Github PK
View Code? Open in Web Editor NEWWebSQL proxy for Sencha Touch 2
WebSQL proxy for Sencha Touch 2
If you want to see the pictures of my dog, click here. If you want to see what's on my mind, click here.
Hi, I have 7 records in my store. I call
storeExams.removeAll();
storeExams.sync();
I get the following error:
Uncaught TypeError: Cannot read property 'length' of undefined
Line 369
I get the same result if I loop over every record, call remove
and then try to sync.
Hi,
I just toyed a bit with your library in Sencha Touch 2 and I encountered a few bugs which I was able to fix :). It didnt work with id fields with a name other than 'id'. And it threw an error on destroy sometimes.
Here is the patch file:
Index: WebSqlProxy.js
===================================================================
--- WebSqlProxy.js (revision 8794)
+++ WebSqlProxy.js (working copy)
@@ -169,7 +169,7 @@
var name = f.getName(),
type = f.getType().type;
- if (name.toLowerCase() !== 'id') {
+ if (name.toLowerCase() !== me.getPkField().toLowerCase()) {
type = type.replace(/int/i, 'INTEGER')
.replace(/string/i, 'TEXT')
.replace(/auto/i, 'TEXT')
@@ -365,12 +365,12 @@
//inherit
destroy : function (operation, callback, scope) {
- var records = operation.records,
+ var records = operation.getRecords(),
length = records.length,
i;
for (i = 0; i < length; i++) {
- Ext.Array.remove(newIds, records[i].getId());
+// Ext.Array.remove(newIds, records[i].getId());
this.removeRecord(records[i], false);
}
@@ -548,7 +548,7 @@
var me = this;
me.getDb().transaction(function (tx) {
- tx.executeSql('DELETE FROM ' + me.getDbTable + ' WHERE ' + me.getPkField() + ' = ?',
+ tx.executeSql('DELETE FROM ' + me.getDbTable() + ' WHERE ' + me.getPkField() + ' = ?',
[id],
Ext.emptyFn, //on success
Ext.bind(me.onError, me)); // on error
When database is first initialized on a new device and store autoloads, store will load an empty set
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.