Skip to content

Commit

Permalink
fix #634
Browse files Browse the repository at this point in the history
  • Loading branch information
xaksis committed Nov 14, 2019
1 parent c700163 commit 22b87f4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 13 deletions.
15 changes: 12 additions & 3 deletions dev/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}">
</vue-good-table>
<h3>Remote Table</h3>
<!-- <remote-table/> -->
<remote-table/>
<h3>Grouped Table</h3>
<!-- <grouped-table></grouped-table> -->
</div>
Expand Down Expand Up @@ -75,11 +75,20 @@ export default {
},
{
label: 'Age',
field: obj => obj.age,
field: 'age',
type: 'number',
filterOptions: {
enabled: true,
// filterValue: 20,
filterDropdownItems: [
{
value: 24,
text: '24',
},
{
value: 16,
text: '16',
},
],
},
},
{
Expand Down
26 changes: 18 additions & 8 deletions dev/remote-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,36 @@ export default {
type: 'number',
filterOptions: {
enabled: true,
filterDropdownItems: [
{
value: 24,
text: '24',
},
{
value: 16,
text: '16',
},
],
// filterValue: 20,
},
},
{
label: 'Created On',
field: 'createdAt',
type: 'date',
dateInputFormat: 'YYYY-MM-DD',
dateOutputFormat: 'LLL',
dateInputFormat: 'yyyy-MM-dd',
dateOutputFormat: 'PPPP',
},
{
label: 'Percent',
field: 'score',
type: 'percentage',
},
{
label: 'func',
field: this.funcValue,
type: 'number',
},
// {
// label: 'func',
// field: this.funcValue,
// type: 'number',
// },
{
label: 'Valid',
field: 'bool',
Expand Down Expand Up @@ -189,7 +199,7 @@ export default {
onPerPageChange(params) {
console.log('per page change called');
console.log(params);
this.updateParams({perPage: params.currentPerPage});
this.updateParams({ perPage: params.currentPerPage });
this.loadItems();
},
Expand Down
4 changes: 3 additions & 1 deletion src/components/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,9 @@ export default {
paginationOptions: {
handler(newValue, oldValue) {
this.initializePagination();
if (!isEqual(newValue, oldValue)) {
this.initializePagination();
}
},
deep: true,
immediate: true,
Expand Down
2 changes: 1 addition & 1 deletion src/components/VgtPagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default {
if (this.customRowsPerPageDropdown !== null
&& (Array.isArray(this.customRowsPerPageDropdown)
&& this.customRowsPerPageDropdown.length !== 0)) {
this.rowsPerPageOptions = this.customRowsPerPageDropdown;
this.rowsPerPageOptions = cloneDeep(this.customRowsPerPageDropdown);
} else {
//* otherwise we use the default rows per page dropdown
this.rowsPerPageOptions = cloneDeep(DEFAULT_ROWS_PER_PAGE_DROPDOWN);
Expand Down

0 comments on commit 22b87f4

Please sign in to comment.