Hello everyone,
I find myself in a bit of a pickle while working with WebOS enyo.
Although the fact that I am using enyo is irrelevant to my question...
Here is a method I have:
clickPopulate: function(){
// Do some SQL
};
I am utilizing a database class to manage my SQL lite Db connection, and the method interface I am using is:
* Execute an arbitrary SQL command on the database.
*
* If you need to execute multiple commands in a transaction, use queries()
*
* Parameters:
* - sql (string or query object, required)
* - options (object):
* * values (array): replacements for '?' placeholders in SQL
* (only use if not passing a DatabaseQuery object)
* * onSuccess (function): method to call on successful query
* + receives single argument: results as an array of objects
* * onError (function): method to call on error; defaults to logging
*/
query: function(sql, options)
So, I pass it some SQL and options, including an onSuccess callback.
this.$.db.query("SELECT fullName, count(*) FROM user WHERE username=? and password=? GROUP BY username",
{values: [inUser, inPass], onSuccess: enyo.bind(this, this.callBackFunction)});
What I really want is for the SQL result array to be returned to my click handler function - clickPopulate, but since it's the calling method, I can't seem to get it to work?
Any thoughts?