Hi Max
I managed to pass the id using local storage. Now encounter a new but related situation,
Project List page - I have a listview of projects, populated with data in SQLite using generic service. Clicking on any one project will link to a project detail page. This worked.
Project Details page - On this page should be a listview of stores belonging to the project selected on the above page. When I approached this page with a similar generic service and javascript implementation (but pointing to different SQLite DB and tables), the data couldn't be listed. Strangely, the Project listview also stopped rendering (nothing change on this page) when it was working earlier.
Below is the implementation approach taken for the Project Details page. Adapted from that taken for the Project List page.
Please advise what I did wrong. Wasted many hours. Thanks in advance.
var db = window.openDatabase("SQLiteStoreList", "", "SQLiteStoreList", 1024 * 1000);
$t.GetStoreListJS = $t.createClass(null,
{
init: function(requestOptions)
{
this.__requestOptions = $.extend({}, requestOptions);
},
{
ProjectID = localStorage.getItem("ProjectList_ID");
{
settings.success(this.__requestOptions.echo);
} else
{
var ourFinalArray = [];
Code: Select all
db.transaction(function(tx) { tx.executeSql('SELECT * FROM "' + ProjectID + '"' , [], function(tx, results)
{
var len = results.rows.length,
i;
if (len == 0)
{
console.log("No record");
}
else
{
for (i = 0; i < len; i++) {
ourFinalArray.push(results.rows.item(i)); }
settings.success(JSON.stringify(ourFinalArray));
}
settings.complete('success');
}); });
};
}
});