Fixed #841 - New Lazy DataTable Demo with Remote Source

pull/756/head
Tuğçe Küçükoğlu 2021-01-06 21:38:46 +03:00
parent 4bdebad445
commit 1d1c70827b
2 changed files with 13 additions and 9 deletions

View File

@ -4,17 +4,21 @@ export default class CustomerService {
getCustomersSmall() { getCustomersSmall() {
return axios.get('demo/data/customers-small.json').then(res => res.data.data); 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); 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); 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); 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)
}
} }

View File

@ -58,7 +58,7 @@ export default {
this.loading = true; this.loading = true;
setTimeout(() => { setTimeout(() => {
this.customerService.getCustomersLarge().then(data => { this.customerService.getCustomers().then(data => {
this.datasource = data; this.datasource = data;
this.totalRecords = data.length, this.totalRecords = data.length,
this.customers = this.datasource.slice(0, 10); this.customers = this.datasource.slice(0, 10);
@ -105,7 +105,7 @@ export default {
this.loading = true; this.loading = true;
setTimeout(() => { setTimeout(() => {
this.customerService.getCustomersLarge().then(data => { this.customerService.getCustomers().then(data => {
this.datasource = data; this.datasource = data;
this.totalRecords = data.length, this.totalRecords = data.length,
this.customers = this.datasource.slice(0, 10); this.customers = this.datasource.slice(0, 10);