Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination Options - customize footer navigation info #810

Closed
1 task done
dsinibaldi77 opened this issue Feb 1, 2021 · 4 comments
Closed
1 task done

Pagination Options - customize footer navigation info #810

dsinibaldi77 opened this issue Feb 1, 2021 · 4 comments
Assignees
Labels

Comments

@dsinibaldi77
Copy link

dsinibaldi77 commented Feb 1, 2021

Issue Type

  • Enhancement Request

Specs

Version "2.21.3", all browsers

Expected Behavior

https://xaksis.github.io/vue-good-table/guide/configuration/pagination-options.html#enabled

In the pagination options add a parameter to customize the text "Showing X to XX of XX entries".
Now is implemented only ofLabel.

@TheJaredWilcurt
Copy link
Collaborator

I think it makes the most sense to remove the ofLabel prop, and replace it with a string containing keywords that represent dynamic data. Many languages are not structured the same as English and may need to move parts of the data around inside of a sentence to sound correct.

So you instead pass in:

paginationOptions: {
  text: 'Displaying {{ first }} thru {{ last }} of {{ total }} kittens.'
}

Then VGT could take that value and replace the data in it:

computed: {
  paginationText: function () {
    let text = this.paginationOptions.text || 'Showing {{ first }} to {{ last }} of {{ total }} entries.';
    text = text.replace('{{ first }}', this.first);
    text = text.replace('{{ last }}', this.last);
    text = text.replace('{{ total }}', this.total);
    return text;
  }
}

Then people can localize it to any language, or just tweak the formatting back to its previous state 1-100 of 450.

@xaksis
Copy link
Owner

xaksis commented Feb 24, 2021

Yeah, I plan on re-writing the pagination bit this weekend. Recent PRs have added a hodgepodge of code/functionality to it and it needs some TLC.

@xaksis
Copy link
Owner

xaksis commented Feb 27, 2021

new property infoFn added paginationOptions allows you to lay out info however you like:
https://xaksis.github.io/vue-good-table/guide/configuration/pagination-options.html#pagination-label-text-options

closing.

@xaksis xaksis closed this as completed Feb 27, 2021
@dsinibaldi77
Copy link
Author

Thank you @xaksis ! I love vue-good-table !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants