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