From 1d1c70827be844a4855ad507381933479118e7dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Wed, 6 Jan 2021 21:38:46 +0300 Subject: [PATCH] Fixed #841 - New Lazy DataTable Demo with Remote Source --- src/service/CustomerService.js | 18 +++++++++++------- src/views/datatable/DataTableLazyDemo.vue | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/service/CustomerService.js b/src/service/CustomerService.js index 048becd72..2b2820713 100755 --- a/src/service/CustomerService.js +++ b/src/service/CustomerService.js @@ -4,17 +4,21 @@ export default class CustomerService { getCustomersSmall() { return axios.get('demo/data/customers-small.json').then(res => res.data.data); - } + } - getCustomersMedium() { + getCustomersMedium() { return axios.get('demo/data/customers-medium.json').then(res => res.data.data); - } + } - getCustomersLarge() { + getCustomersLarge() { return axios.get('demo/data/customers-large.json').then(res => res.data.data); - } + } - getCustomersXLarge() { + getCustomersXLarge() { return axios.get('demo/data/customers-xlarge.json').then(res => res.data.data); - } + } + + getCustomers() { + return axios.get('https://www.primefaces.org/data/customers').then(res => res.data.customers) + } } \ No newline at end of file diff --git a/src/views/datatable/DataTableLazyDemo.vue b/src/views/datatable/DataTableLazyDemo.vue index bef270a61..74fcb6a74 100755 --- a/src/views/datatable/DataTableLazyDemo.vue +++ b/src/views/datatable/DataTableLazyDemo.vue @@ -58,7 +58,7 @@ export default { this.loading = true; setTimeout(() => { - this.customerService.getCustomersLarge().then(data => { + this.customerService.getCustomers().then(data => { this.datasource = data; this.totalRecords = data.length, this.customers = this.datasource.slice(0, 10); @@ -105,7 +105,7 @@ export default { this.loading = true; setTimeout(() => { - this.customerService.getCustomersLarge().then(data => { + this.customerService.getCustomers().then(data => { this.datasource = data; this.totalRecords = data.length, this.customers = this.datasource.slice(0, 10);