[2014] bootstrap-table - v1.3
doc - http://bootstrap-table.wenzhixin.net.cn/documentation
2021 - v1.18 - [bootstrap-table] use of child table
JavaScript:
//test
<?php
$db = connect();
$recs = getSet($db,"select id,created,seller,total_cost,type from customers", null);
?>
<script>
$(function() {
///////////////////////////////////////////////////////////// FILL table
var jArray_recs = <?php echo json_encode($recs); ?>; //convert PHP variable to JSON
//enumerate the records
var tbl_recs = "";
for (var i = 0; i < jArray_recs.length; i++)
{
tbl_recs += "[TR]" +
"[TD]" + jArray_recs[i]["id"] + "[/TD]" +
"[TD]" + jArray_recs[i]["created"] + "[/TD]" +
"[TD]" + jArray_recs[i]["seller"] + "[/TD]" +
"[TD]" + jArray_recs[i]["total_cost"] + "[/TD]"
"[TD]" + jArray_recs[i]["type"] + "[/TD][/TR]";
}
$("#tbl_rows").html(tbl_recs); //set to table
///////////////////////////////////////////////////////////// FILL table
$("#tbl").bootstrapTable(); //transform to magic!
})
</script>
[TABLE]
[TD]
[TR]
[TD]ID[/TD]
[TD]Created[/TD]
[TD]Seller[/TD]
[TD]Total Cost[/TD]
[TD]Type[/TD]
[/TR]
<tbody id="tbl_rows">
[/TABLE]
doc - http://bootstrap-table.wenzhixin.net.cn/documentation
JavaScript:
//is invalid way to use data-sort-name on TH, but add it here coz
//return all data attributes with _date_data
//http://jsfiddle.net/e3nk137y/1434/
[TD]Date[/TD]
2021 - v1.18 - [bootstrap-table] use of child table