- Fixed pagination not refreshing the data...

- Start creating single page of an Event
This commit is contained in:
Paolo Arena
2019-11-06 22:28:45 +01:00
parent 571e948d39
commit 7fe6b5fb6a
16 changed files with 112 additions and 96 deletions

View File

@@ -180,6 +180,10 @@ export default class CGridTableRec extends Vue {
const startRow = (page - 1) * rowsPerPage
const endRow = startRow + fetchCount
console.log('startRow', startRow)
this.serverData = []
// fetch data from "server"
this.fetchFromServer(startRow, endRow, filter, sortBy, descending).then((ris) => {
@@ -189,12 +193,14 @@ export default class CGridTableRec extends Vue {
if (this.returnedData === []) {
this.serverData = []
} else {
if (this.serverData.length > 0)
this.serverData.splice(0, this.serverData.length, ...this.returnedData)
else
this.serverData = [...this.returnedData]
// if (this.serverData.length > 0)
// this.serverData.splice(0, this.serverData.length, ...this.returnedData)
// else
this.serverData = [...this.returnedData]
}
console.log('this.serverData', this.serverData)
// don't forget to update local pagination object
this.pagination.page = page
this.pagination.rowsPerPage = rowsPerPage
@@ -358,7 +364,7 @@ export default class CGridTableRec extends Vue {
// console.log('this.filter', this.filter)
this.onRequest({
pagination: this.pagination,
pagination: this.pagination
})
}