How to add button in every single column?
How to add button in every single column?
fanggap
Posts: 1Questions: 1Answers: 0
My jsp file
<table id="tblPeriodik" class="display" cellspacing="0">
<!-- Header Table -->
<thead>
<tr>
<th>Id</th>
<th>Tinggi</th>
<th>Berat</th>
<th>Jarak</th>
<th>Waktu</th>
<th>Anak ke</th>
<th>jumlah kk</th>
<th>jumlah adik</th>
</tr>
</thead>
<!-- Footer Table -->
<tfoot>
<tr>
<th>Id</th>
<th>Tinggi</th>
<th>Berat</th>
<th>Jarak</th>
<th>Waktu</th>
<th>Anak ke</th>
<th>jumlah kk</th>
<th>jumlah adik</th>
</tr>
</tfoot>
</table>
My js file:
$(document).ready( function () {
storeData();
button();
function storeData() {
var table = $('#tblPeriodik').DataTable({
paging: true,
sort: true,
searching: true,
"sAjaxSource": window.location + "api/periodik/showAll",
"sAjaxDataProp": "",
"order": [[ 0, "asc" ]],
"aoColumns": [
{ "mData": "id","searchable": true},
{ "mData": "tinggi_badan","searchable": true },
{ "mData": "berat_badan","searchable": true },
{ "mData": "jarak_sekolah","searchable": true },
{ "mData": "waktu_tempuh","searchable": true },
{ "mData": "anak_ke","searchable": true },
{ "mData": "jml_kakak","searchable": true },
{ "mData": "jml_adik","searchable": true }]
});
}
});
I wanto to add some buttons like edit, delete etc. How can I achieve that?
I'll really appreciate for all your answer. Thanks.
Oh and I am using spring boot btw.
This discussion has been closed.