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 option to display blank rows to fill to paginated number #9

Merged
merged 4 commits into from
Sep 10, 2018

Conversation

reed-jones
Copy link
Contributor

No description provided.

options.js Outdated
@@ -3,5 +3,6 @@ export default {
iconClasses: null,
iconSide: '',
searchWhen: 'onDelay',
timeoutDelay: 1000
timeoutDelay: 1000,
showEmpty: true
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this should default to false as it isn't really a function that makes sense to use in most cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

woops, I meant to do that. I was just testing that it worked

@@ -98,6 +99,11 @@
default: true
},

showEmpty: {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add docs to this. Its kind of a confusing functionality.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would add the docs into the README with everything else, that way it's all in one place.

Copy link
Contributor

@codymoorhouse codymoorhouse left a comment

Choose a reason for hiding this comment

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

Please bump the version number in the package.json as well

@@ -98,6 +99,11 @@
default: true
},

showEmpty: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would add the docs into the README with everything else, that way it's all in one place.

@@ -261,7 +267,19 @@
this.loading = true;
axios.get(url, { params: this.defaultParams })
.then(response => {
this.tableData = response.data.data;
if (this.showEmpty && response.data.data.length < this.paginate) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be safer to do a check on the response.data && response.data.data. I know this wasn't in here before, but would be useful.

...new Array(this.paginate - response.data.data.length).fill(blank)
]
} else {
this.tableData = response.data.data;
Copy link
Contributor

Choose a reason for hiding this comment

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

See above comment

@kotarCreative kotarCreative merged commit 88db92a into PDERAS:master Sep 10, 2018
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

3 participants