Initial Comit
This commit is contained in:
7
DPMMobileB4X/test/MyWebApi/Objects/www/assets/js/bootstrap.bundle.min.js
vendored
Normal file
7
DPMMobileB4X/test/MyWebApi/Objects/www/assets/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
DPMMobileB4X/test/MyWebApi/Objects/www/assets/js/jquery.min.js
vendored
Normal file
2
DPMMobileB4X/test/MyWebApi/Objects/www/assets/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,50 @@
|
||||
$( document ).ready(function() {
|
||||
$("#btnsearch").click(function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/",
|
||||
data: $("form").serialize(),
|
||||
success: function(response)
|
||||
{
|
||||
if (response.s == "ok") {
|
||||
// console.log(response.r);
|
||||
var tbl_head = "";
|
||||
var tbl_body = "";
|
||||
if (response.r.length) {
|
||||
tbl_head = "<thead class=\"bg-light\"><th style=\"text-align: right\">#</th><th>Code</th><th>Category</th><th>Name</th><th style=\"text-align: right\">Price</th></thead>";
|
||||
tbl_body += "<tbody>";
|
||||
$.each(response.r, function() {
|
||||
var tbl_row = "";
|
||||
$.each(this, function(key, value) {
|
||||
if (key == "ee" || key == "aa")
|
||||
{
|
||||
tbl_row += "<td style=\"text-align: right\">"+value+"</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
tbl_row += "<td>"+value+"</td>";
|
||||
}
|
||||
});
|
||||
tbl_body += "<tr>"+tbl_row+"</tr>";
|
||||
});
|
||||
tbl_body += "</tbody>";
|
||||
}
|
||||
else
|
||||
{
|
||||
tbl_body = "<tr><td>No results</td></tr>";
|
||||
}
|
||||
$("#results table").html(tbl_head+tbl_body);
|
||||
}
|
||||
else {
|
||||
$(".alert").html(response.e);
|
||||
$(".alert").fadeIn();
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
$(".alert").html(thrownError);
|
||||
$(".alert").fadeIn();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user