Add delay
parent
18f6307ab7
commit
8636b1ee6d
|
@ -46,7 +46,6 @@
|
|||
</div>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="customers" :lazy="true" :paginator="true" :rows="10" :filters="filters" ref="dt"
|
||||
<DataTable :value="customers" :lazy="true" :paginator="true" :rows="10" :filters="filters" ref="dt"
|
||||
:totalRecords="totalRecords" :loading="loading" @page="onPage($event)" @sort="onSort($event)">
|
||||
<Column field="name" header="Name" filterMatchMode="startsWith" ref="name" :sortable="true">
|
||||
|
@ -119,11 +118,13 @@ export default {
|
|||
loadLazyData() {
|
||||
this.loading = true;
|
||||
|
||||
setTimeout(() => {
|
||||
this.customerService.getCustomers({lazyEvent: JSON.stringify( this.lazyParams )}).then(data => {
|
||||
this.customers = data.customers;
|
||||
this.totalRecords = data.totalRecords;
|
||||
this.loading = false;
|
||||
});
|
||||
}, Math.random() * 1000 + 250);
|
||||
},
|
||||
onPage(event) {
|
||||
this.lazyParams = event;
|
||||
|
@ -252,11 +253,13 @@ export default {
|
|||
loadLazyData() {
|
||||
this.loading = true;
|
||||
|
||||
setTimeout(() => {
|
||||
this.customerService.getCustomers({lazyEvent: JSON.stringify( this.lazyParams )}).then(data => {
|
||||
this.customers = data.customers;
|
||||
this.totalRecords = data.totalRecords;
|
||||
this.loading = false;
|
||||
});
|
||||
}, Math.random() * 1000 + 250);
|
||||
},
|
||||
onPage(event) {
|
||||
this.lazyParams = event;
|
||||
|
@ -298,11 +301,13 @@ export default {
|
|||
loadLazyData() {
|
||||
this.loading = true;
|
||||
|
||||
setTimeout(() => {
|
||||
this.customerService.getCustomers({lazyEvent: JSON.stringify( this.lazyParams )}).then(data => {
|
||||
this.customers = data.customers;
|
||||
this.totalRecords = data.totalRecords;
|
||||
this.loading = false;
|
||||
});
|
||||
}, Math.random() * 1000 + 250);
|
||||
},
|
||||
onPage(event) {
|
||||
this.lazyParams = event;
|
||||
|
|
Loading…
Reference in New Issue