Git Product home page Git Product logo

ext.data.proxy.websql's Introduction

If you want to see the pictures of my dog, click here. If you want to see what's on my mind, click here.

๐Ÿ‘จ๐Ÿ‘ฉ Social ๐Ÿ”

ext.data.proxy.websql's People

Contributors

grgur avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ext.data.proxy.websql's Issues

Can't remove records

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.

Some bug fixes

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.