examples/simple example/scripts/index.js
function showTableData() {
    connection.runSql('select * from Student').then(function (students) {
        var HtmlString = "";
        students.forEach(function (student) {
            HtmlString += "<tr ItemId=" + student.Id + "><td>" +
                student.Name + "</td><td>" +
                student.Gender + "</td><td>" +
                student.Country + "</td><td>" +
                student.City + "</td><td>" +
                "<a href='#' class='edit'>Edit</a></td>" +
                "<td><a href='#' class='delete''>Delete</a></td>";
        })
        $('#tblGrid tbody').html(HtmlString);
    }).catch(function (error) {
        console.log(error);
    });
}
function showTableData() {
    connection.runSql('select * from Student').then(function (students) {
        var HtmlString = "";
        students.forEach(function (student) {
            HtmlString += "<tr ItemId=" + student.Id + "><td>" +
                student.Name + "</td><td>" +
                student.Gender + "</td><td>" +
                student.Country + "</td><td>" +
                student.City + "</td><td>" +
                "<a href='#' class='edit'>Edit</a></td>" +
                "<td><a href='#' class='delete''>Delete</a></td>";
        })
        $('#tblGrid tbody').html(HtmlString);
    }).catch(function (error) {
        console.log(error);
    });
}
function showTableData ( ) { connection . runSql ( 'select * from Student' ) . then ( function ( students ) { var HtmlString = "" ; students . forEach ( function ( student ) { HtmlString += "<tr ItemId=" + student . Id + "><td>" + student . Name + "</td><td>" + student . Gender + "</td><td>" + student . Country + "</td><td>" + student . City + "</td><td>" + "<a href='#' class='edit'>Edit</a></td>" + "<td><a href='#' class='delete''>Delete</a></td>" ; } ) $ ( '#tblGrid tbody' ) . html ( HtmlString ) ; } ) . catch ( function ( error ) { console . log ( error ) ; } ) ; }
This function refreshes the table
This function refreshes the table