Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var db = window.openDatabase("MELInsp", "1.0", "MEL Inspection DB", 200000);
- $t.jsGetMyLocalInspections = $t.createClass(null, {
- init: function(requestOptions) {
- this.__requestOptions = $.extend({}, requestOptions);
- },
- process: function(settings) {
- if (this.__requestOptions.echo) {
- settings.success(this.__requestOptions.echo);
- } else {
- var ourFinalArray = [];
- db.transaction(function(tx) {
- tx.executeSql('SELECT * FROM MyInspections', [], function(tx, results) {
- alert(results.rows.length + ' records');
- var len = results.rows.length,
- i;
- for (i = 0; i < len; i++) {
- // for each row
- ourFinalArray.push(results.rows.item(i));
- // pushing row object to an array
- }
- console.log("first JSON: " + JSON.stringify(ourFinalArray));
- console.log("second JSON: " + JSON.stringify(ourFinalArray));
- settings.success(JSON.stringify(ourFinalArray));
- settings.complete('success');
- });
- });
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement