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

Add support for backend pagination to Table #221

Merged
merged 2 commits into from Aug 8, 2017

Conversation

cappuc
Copy link

@cappuc cappuc commented Aug 4, 2017

This add support for backend paginated data to b-table.
I know that this can be done using separated b-pagination component but i think it's nice to have support directly in the b-table component.
I added 2 props to b-table:

  • backendPaginated: Boolean that enable backend pagination
  • total: total number of items (from backend)
    If backendPaginated is true the number of items is read from total otherwise it's the length of data

Copy link
Member

@rafaberaldo rafaberaldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you get the file updated? I've change a few things in the last days, rest is great, thanks ;)

No need for that, nevermind, just update what I've highlighted, thanks!

* only if it's backend-paginated.
*/
total(newTotal) {
if (this.backendPagination) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to

if (!this.backendPagination) return

this.newDataTotal = newTotal

It's a good practice to return the function as soon as possible.

@rafaberaldo rafaberaldo self-assigned this Aug 7, 2017
@cappuc
Copy link
Author

cappuc commented Aug 8, 2017

I changed the function as requested

@rafaberaldo
Copy link
Member

Thanks!

@rafaberaldo rafaberaldo merged commit 8d225b2 into buefy:dev Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants