Implemented server-side datatables for notes list for #3790 #3792
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #3790
After implementing DataTables on the notes & deeds list, these pages have performance issues on long lists because all of the rows must be loaded by the server at once.
To fix this, this PR changes the notes DataTable to use server-side processing. This means that the server only loads the currently displayed rows at once, eliminating the issue for large tables. This also means that all sorting and searching is handled on the server-side instead of the client-side, resulting in a slower UI (but it's consistent over all table lengths!)
I used the ajax-datatables-rails gem, which handles a majority of the server-side processing.
I split the deeds list and notes list, so the deeds list is always paginated and the notes list is always a DataTable. Now, the notes list has individual sortable columns rather than one large "deed" column.
The notes list for a collection:
The all notes list: