Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Christopher J. Brody
    @brodybits
    That looks very strange. It would help to know how you create and populated the table and also which platform you see this on
    I can look at this issue sometime next week.
    laoyao
    @laoyao
    @brodybits hi
    are you on line?
    Christopher J. Brody
    @brodybits
    One moment
    What is going on?
    Adrienrx
    @adrienrx
    Can i create this function in my sqlite database ?
    Christopher J. Brody
    @brodybits
    You could add user-defined functions to the Objective-C code for iOS, https://github.com/liteglue/Android-sqlite-native-driver for Android, or the embedded SQLite3-WinRT library for Windows/Windows Phone 8.1. To get user defined functions working in Javascript would be extremely difficult (if possible at all) since it is an asynchronous interface.
    laoyao
    @laoyao
    Is there some people on line
    Why ios version transaction only run one time?when i
    call on second time,there is no reponse
    Anyone meet this satuation?
    Christopher J. Brody
    @brodybits
    Do you mean that you can only run one transaction, or do you try to try to run the same transaction multiple times (which is not allowed)
    ?
    laoyao
    @laoyao
    Same transaction run on click event
    First click return the result
    second click has no response
    Christopher J. Brody
    @brodybits
    Do you mean that the click event handler has code that executes a transaction with a callback, and after the second click the transaction callback function is not called?
    laoyao
    @laoyao
    Yeah
    function query(){
            db.transaction(function(tx) {
                tx.executeSql("select distinct contractor_name from construction_range;", [], function(tx,res) {
                    alert(JSON.stringify(res));
                });
            });
         }
    my function
    is there any problem?
    Christopher J. Brody
    @brodybits
    I do not recommend using JSON.stringify(res), since res is not really a JSON object.
    res has the following members: rows, rowsAffected, and sometimes insertId. The rows member has a length member and an item function.
    laoyao
    @laoyao
    ok
    but the second click has no response,any soluation?
    can u give me some advise?
    Christopher J. Brody
    @brodybits
    Try changing the alert statement to something like: alert("res.rows.length: " + res.rows.length + (res.rows.length == 0) ? "" : " item(0): " + JSON.stringify(res.rows.item(0)));
    laoyao
    @laoyao
    i change alert(“run”), but second click not called
    is this a bug?
    when i change this line:

    SQLitePlugin.prototype.transaction = function(fn, error, success) {
    if (!this.openDBs[this.dbname]) {
    error(newSQLError('database not open'));
    return;
    }
    // To Fix
    // this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, true, false));
    this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, false, false));

    };

    in sqliteplugin.js, then the second is called
    Christopher J. Brody
    @brodybits
    This does not look right. I will try it myself and let you know.
    laoyao
    @laoyao
    many thanks
    in my project i change the opendb method like following:
    opendb: argsArray(function(args) {
    var errorcb, okcb, openargs;
    openargs = {
    name: args[0]
    };
    okcb = args1;
    errorcb = args2;
    return new SQLitePlugin(openargs, okcb, errorcb);
    }),
    is there any problem?
    okcb = args1;
    errorcb = args2;
    Christopher J. Brody
    @brodybits
    I cannot see any problem here
    What if you would do your test with a statement like this: tx.executeSql("SELECT 1;", [], function(tx, res) { alert("SELECT 1 OK"); });
    Christopher J. Brody
    @brodybits
    would you still see the same issue?
    laoyao
    @laoyao
    still have the problem
    Christopher J. Brody
    @brodybits
    I am trying to reproduce it, hang on
    laoyao
    @laoyao
    many thanks
    Christopher J. Brody
    @brodybits
    I spent 2-3 hours trying to get click events until I discovered this article: http://www.shdon.com/blog/2013/06/07/why-your-click-events-don-t-work-on-mobile-safari
    Christopher J. Brody
    @brodybits
    @laoyao when I try the test in a fresh project (using JQuery Mobile) it is working OK for me. Can you please try it in a fresh project?
    laoyao
    @laoyao
    i make some custom code in sqliteplugin.js and sqliteplugin.m
    i give the custom file to u?can you help me test it in your fresh project?