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

Pager dropdown option with value same as "all". #1364

Merged
merged 1 commit into from
Mar 21, 2017
Merged

Pager dropdown option with value same as "all". #1364

merged 1 commit into from
Mar 21, 2017

Conversation

simenflatby
Copy link
Contributor

Fixed an issue that occurred if you had an option in the pager dropdown with the same value as the total amount of table rows. When you selected such an option, the option with the value "all" was selected.

…wn with the same value as the total amount of table rows. When you selected such an option, the option with the value "all" was selected.
@Mottie
Copy link
Owner

Mottie commented Mar 1, 2017

Hi @simenflatby!

I'm out of the country with only my cell until next week so I won't be able to review this PR until then.

Would you please elaborate on the use case? To me, in my brief scan, it looks like this change will target the "all" option if it exists, or fallback to the same set size. Correct? If so, it sounds good to me, the pager widget would also need to be updated, but I can do that when I return.

@simenflatby
Copy link
Contributor Author

simenflatby commented Mar 2, 2017

Hi @Mottie

Elaboration as asked for:
Behaviour after the change:

  • If any option other than "all" is chosen it's just set as before.
  • If the "all" option is chosen it's just set as before.
  • If an option with the same value as the total amount of rows in the table are chosen that option is set instead of the "all" option.

Before this change: If you have a total of 500 rows in your table and choose the 500 option, the "all" option is chosen.
After this change: If you have a total of 500 rows in your table and choose the 500 option, the 500 option is chosen.

<select>
    <option value="50" selected>50</option>
    <option value="100">100</option>
    <option value="500">500</option>
    <option value="all">All rows</option>
</select>

I'm sorry that I didn't update the pager widget. I actually didn't realize that it was a widget :-P

@Mottie Mottie mentioned this pull request Mar 16, 2017
@Mottie Mottie merged commit 82889c6 into Mottie:master Mar 21, 2017
@Mottie
Copy link
Owner

Mottie commented Mar 21, 2017

Thanks again!

@Mottie
Copy link
Owner

Mottie commented Apr 2, 2017

I've updated the code you provided, please try the update in v2.28.6 to make sure I didn't break anything on your end. Thanks again!

@simenflatby
Copy link
Contributor Author

Thank you. It now works like a charm 👍

@simenflatby simenflatby deleted the pager-dropdown-option-value-same-as-all branch April 5, 2017 09:08
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.

2 participants