-
Notifications
You must be signed in to change notification settings - Fork 464
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
Fix copy behavior for sorted and/or filtered grid #18695
Conversation
PR Changes
|
Can you explain the following two things at a high level in the PR description?
|
Looks like this PR only addresses copying, but the same problem occurs for all copy/save targets. Maybe we need a more fundamental fix here. Unfortunately, it seems that ADS has the same issue, where the "save" actions don't respect sorting and filtering, probably because they occur on the backend. Perhaps we need a UX solution in the meantime (e.g. "copy selection" where we can support that and "save all as .xyz" where we can't) |
let rowIdToSelectionMap = new Map<number, ISlickRange[]>(); | ||
let rowIdToRowMap = new Map<number, DbCellValue[]>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A selection potentially spans multiple rows, right? So will this map have multiple rowId entries pointing to the same ISlickRange?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's correct
I gave the PR branch a quick test and can confirm copying is fixed with sorted/filtered grid. One more question: I noticed the filter state is kept during context switch but the sorting state is not, is this intentional or do we want to fix it later?
Can confirm save is still broken, we might want to create a seperate issue for tracking. |
Yeah, we want to keep the sort state as well, I will add an issue to track this as well as an issue for the save targets |
* fix copy behavior for sorted grid * cleanup * refactor pr comments * assign copy string * refactor * add comments * remove console.log
* fix copy behavior for sorted grid * cleanup * refactor pr comments * assign copy string * refactor * add comments * remove console.log
Correctly copies the grid values for a grid that has been sorted and/or filtered.
Before, we were using a getRows call to STS which fetches the data based on the initial query. Once we sort or filter any data in the grid (which triggers isDataInMemory flag = true), we should use the dataProvider to tell us what data the user wants to copy, since it knows the context of the sort or filter states.
Fixes #18516
Fixes #18620