Methods ≈
<div id="basicdatatable"></div>
Rovnaké ako v základnom príklade...
<table border="1" width="100%" cellspacing="0" cellpadding="3">
<thead>
<tr>
<th>No.</th>
<th>ID</th>
<th>Name</th>
<th><input type="checkbox" @change="checkedAll('fld_ID', checkAll)" v-model="checkAll" /></th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in pageItems" :key="item.fld_ID">
<td> {{ index +1 }}. </td>
<td> {{ item.fld_ID }} </td>
<td> {{ item.fld_Name }} </td>
<td align="center"> <input type="checkbox" @change="checkedRow( index, 'fld_ID' )" v-model="item.checked"> </td>
</tr>
</tbody>
</table>
<div align="right">
<!-- PAGINATION -->
<bdt-pagination width="2.5em" :limit="limit" :page="page" :pages="pages" :btn-final="true" :btn-once="true" @set-page="setPage" @set-limit="setLimit" />
</div>
import basicDataTable from "https://api.pim.sk/api/basic-data-table/bdt.min.mjs"
const bdt = new basicDataTable({
id: "bdtBex",
selector: "#basicdatatable",
items: data,
template: template,
onPage: fnOnPage,, // user function after action: change page
onItems: fnOnItems, // user function after action: change items
onFilter: fnOnFilter, // user function after action: change filter
onChecked: fnOnChecked, // user function after action: change any checked
onSort: fnOnSort, // user function after action: after sort
onMove: fnOnMove, // user function after action: after move
});
function fnOnPage(){
console.log( 'fnOnPage()' )
}
function fnOnItems(){
console.log( 'fnOnItems()' )
}
function fnOnFilter(){
console.log( 'fnOnFilter()' )
}
function fnOnChecked(){
console.log( 'fnOnChecked()' )
}
function fnOnSort(){
console.log( 'fnOnSort()' )
}
function fnOnMove(){
console.log( 'fnOnMove()' )
}