First create solution
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<div data-options="dxView : { name: 'Test', title: 'Test' } " >
|
||||
<div data-options="dxContent : { targetPlaceholder: 'content' } " class="dx-content-background">
|
||||
<p style="padding: 5px">To learn more about DevExtreme, check out the <a href="http://go.devexpress.com/DevExtreme_LearningCenter.aspx" target="_blank">Learning Center</a>.</p>
|
||||
<p style="padding: 5px">Note: To disable the simulator debugging environment, set the project's 'Run in Simulator' property to false.</p>
|
||||
<div data-bind="dxButton: { text: 'Button1',onClick: onClick }"></div>
|
||||
<div id="status" name="status">Status Message</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,44 @@
|
||||
Nuvolar_Scanner_Android.Test = function (params) {
|
||||
"use strict";
|
||||
|
||||
function errorHandler(transaction, error) {
|
||||
alert("Error : " + error.message + " in " + query);
|
||||
}
|
||||
|
||||
var viewModel = {
|
||||
onClick: function (e) {
|
||||
var db = openDatabase('mydb', '1.0', 'Test DB', 10 * 1024 * 1024);
|
||||
var msg;
|
||||
|
||||
db.transaction(function (tx) {
|
||||
//tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)',null,errorHandler);
|
||||
tx.executeSql('CREATE TABLE IF NOT EXISTS Products (id unique, ProductNumber, ShortName,Barcode)');
|
||||
//tx.executeSql('INSERT INTO LOGS (id, log) VALUES (1, "foobar")');
|
||||
//tx.executeSql('INSERT INTO LOGS (id, log) VALUES (2, "logmsg")');
|
||||
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (4, "Varuba")');
|
||||
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (3, "minyime")');
|
||||
msg = '<p>Log message created and row inserted.</p>';
|
||||
document.querySelector('#status').innerHTML = msg;
|
||||
});
|
||||
|
||||
db.transaction(function (tx) {
|
||||
tx.executeSql('SELECT * FROM LOGS', [], function (tx, results) {
|
||||
var len = results.rows.length, i;
|
||||
msg = "<p>Found rows: " + len + "</p>";
|
||||
document.querySelector('#status').innerHTML += msg;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
msg = "<p><b>" + results.rows.item(i).log + "</b></p>";
|
||||
document.querySelector('#status').innerHTML += msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}, null);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return viewModel;
|
||||
};
|
||||
Reference in New Issue
Block a user