All,
I am working with WebOS enyo, but having a really senior moment....
Basically the fact its enyo has no relation to my question however...
I have a method:
clickPopulate: function(){
// Do some SQL
};
I am using a database class to handle my SQL lite Db connection, the interface for the method 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 anyway i send it some SQL and some options, one of which is the 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 to be able to do is have the SQL result array return to my click handler function - clickPopulate, but as its the calling method, i cant get it to work?
Any ideas?