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

Preventing re-sort and re-filter when updating data #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

montrothstein
Copy link

We have as use case where users are working through a list of items in a table. They may have applied a filter and/or sort to the table. As they work through the list changes they make can be to values used for sorting or filtering.

We want the changes to appear in the table but we don't want them to loose their place in the list.

To Address this we added a "hold-order" option to draw() which in turn enables a ignoreSortAndFilter flag on _fnReDraw(). This disables sorting and filtering therefore achieving the desired effect.

I don't know how useful this would be to others but I thought I'd contribute it.

…ReDraw() so that data may be updated without re-flowing the table.
@DataTables
Copy link
Collaborator

Does the existing page option not do what you need?

@montrothstein
Copy link
Author

I failed to mention in my writeup that we need to handle inserts as well as edits. The 'page' option shows edits but not inserts.

Obviously inserts (or deletes) can cause a shift in position. If there are multiple at once then the shift could be significant. However our inserts are all singular and a slight shift (even if the currently selected row moves to the next page) is less disorienting than a full re-sort/filter.

@DataTables
Copy link
Collaborator

Thanks for the extra info. Yes, it sounds like there might be a couple of issues that would need to be catered for in the general case - I'm afraid I don't have the time too look into it in detail just at the moment, but I will leave this one open until I do (which hopefully won't be too far away!).

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