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 not reset page when adding a filter query #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add option to not reset page when adding a filter query #81

wants to merge 2 commits into from

Conversation

theodorejb
Copy link
Contributor

Currently, adding a custom query method always resets the page. However, this is not always the desired behavior. For example, it may be necessary to add custom query methods as part of the init process without resetting the page (so that page links and bookmarks will work).

Additionally, the page should only be reset if the filter is not already applied. This allows navigation between pages when a filter is applied to work correctly with back/forward buttons.

Also, the page should only reset if the filter is not already applied
@JangoSteve
Copy link
Member

Thanks for this. A couple small things:

  • Lets call the argument skipPageReset, which will make it consistent with other similar arguments in other functions throughout dynatable.
  • Lets make the very last condition be a literal equality check (i.e. !== instead of !=, since we don't want to make assumptions about what the actual query function will be (so the only assumption being that two identical values are going to be considered identical). In other words, it's possible that a query function considers two values inequivalent that would still have != be false.

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