TMP variable
<div id="basicdatatable"></div>
<div id="userApp">
User Input outside basic-data-table:
<input type="number" v-model="myInputValue" />
</div>
Rovnaké ako v základnom príklade...
<!-- SEARCHING -->
<p>Universal search: <bdt-filter @use-filter="setFilter" @reset-filter="resetFilter" title="Inline Filter" placeholder="search..." /></p>
<table border="1" width="100%" cellspacing="0" cellpadding="3">
<thead>
<tr>
<th>No.</th>
<th><bdt-sort type="number" field="fld_ID" @sorting="sorting">ID</bdt-sort></th>
<th><bdt-sort field="fld_Name" @sorting="sorting">Name</bdt-sort></th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in pageItems" :key="item.fld_ID">
<td align="center"> {{ ((page -1) * limit) +index +1 }}. </td>
<td> {{ item.fld_ID }} </td>
<td> {{ item.fld_Name }} </td>
</tr>
</tbody>
<tfoot><tr>
<td colspan="5">My Var: {{ tmp.myInputValue }}</td>
</tr></tfoot>
</table>
import basicDataTable from "https://api.pim.sk/api/basic-data-table/bdt.min.mjs"
const bdt = new basicDataTable({
id: "bdtBex",
selector: "#basicdatatable",
items: daata,
template: template,
limit: 5,
clog: false
});
// User defined function / VUE app / etc.
const userApp = createApp({
data(){return{
myInputValue: 22
}},
watch:{
myInputValue(){
// Assign value
bdt.tmp.myInputValue = this.myInputValue
}
},
}).mount('#userApp');
// Assign value (initialization)
bdt.tmp = { myInputValue: userApp.myInputValue }
Example
zvazit tmp a uv (User Value), tmp sa ukladaju do localStorage (uv zatial neexistuju, ale mohli by byt len online hodnoty)