1
Help for ParamQuery Pro / Re: Implementing Callback Properly
« on: February 08, 2017, 11:33:26 pm »
When I try to simulate building the dataModel data array with a 3 second timeout and passing it through to the grid, it works properly the way it should work so I'm unable to reproduce the issue this way.
I'm thinking the issue may be related to way I have coded the function I'm using to call the data as I am new to working with javascript. This is pretty much the actual code I'm using to build the data array. I know this may not be a paramquery issue, but I was wondering if you noticed anything in my code that might be causing the issue:
I'm thinking the issue may be related to way I have coded the function I'm using to call the data as I am new to working with javascript. This is pretty much the actual code I'm using to build the data array. I know this may not be a paramquery issue, but I was wondering if you noticed anything in my code that might be causing the issue:
Code: [Select]
function getMyTable(callback){
const sqlite3 = require('sqlite3').verbose();
var testoCommerceDB = new sqlite3.Database('app/data/testo_commerce.db');
var myTable = [];
var myTableRow = [];
testoCommerceDB.each("SELECT * FROM myTable_Accounts", function(err, row) {
myTableRow.push(row.myTable_id);
myTableRow.push(row.myTable_creation_date);
myTableRow.push(row.domain);
myTableRow.push(row.myTable_login_url);
myTableRow.push(row.myTable_username);
myTableRow.push(row.myTable_password);
myTableRow.push(row.myTable_ip);
myTableRow.push(row.whm_account_name);
myTable.push(myTableRow);
myTableRow = [];
});
testoCommerceDB.close();
callback(myTable);
console.log(myTable);
}
