Skip to content

perPage & defaultPerPage #17

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

Merged
merged 7 commits into from
Jun 26, 2017
Merged

perPage & defaultPerPage #17

merged 7 commits into from
Jun 26, 2017

Conversation

danilopolani
Copy link
Contributor

Fix #16

perPage will accept an array of values: the one will be the default and then the values are sorted.

Otherwise, you can use defaultPerPage to set the default value. (Example in the README)

Copy link
Owner

@MicroDroid MicroDroid left a comment

Choose a reason for hiding this comment

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

I think this is clean implementation and should be bug-free. If @thepill can test this out for us on his environment to make sure, as I am unable to right now.

README.md Outdated
printable => Add printing functionality => true (default) // Whether printable
customButtons => Custom buttons thingy => [ // Array of objects
perPage => Numbers of rows per page => [10, 20, 30, 40, 50] (default) // Results per page
defaultperPage => Default rows per page => 10 (default) // Default results per page, otherwise it will be the first value of perPage
Copy link
Owner

Choose a reason for hiding this comment

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

defaultperPage should become defaultPerPage

@@ -255,6 +253,36 @@
},

computed: {
perPageOptions: function() {
Copy link
Owner

@MicroDroid MicroDroid Jun 26, 2017

Choose a reason for hiding this comment

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

This can be very significantly shortened with arrow-functions, and the first few lines can just be

var options = (Array.isArray(this.perPage) && this.perPage) || [10, 20, 30, 40, 50];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, I edited the readme for the "typo" and used the shorter way for options

Copy link
Collaborator

Choose a reason for hiding this comment

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

I replaced the longer functions with arrow functions. The rest looks good to me and works in my demo.

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks @danilopolani

@thepill thepill merged commit fd196e8 into MicroDroid:master Jun 26, 2017
@danilopolani danilopolani deleted the fix-perPage branch June 27, 2017 08:15
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.

3 participants