- 
                Notifications
    
You must be signed in to change notification settings  - Fork 484
 
[CB] Ability to pin column in the Data Editor #3794
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
base: devel
Are you sure you want to change the base?
[CB] Ability to pin column in the Data Editor #3794
Conversation
| return () => { | ||
| tableData.editor.action.removeHandler(syncEditor); | ||
| }; | ||
| }, [tableData.editor, selectionAction, handlers, tableData, restoreFocus]); | 
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.
It seems hacky. When I edited the cell, it moved the focus to the wrong place. I deleted that, and during tests, nothing weird appeared with the cell focus. So this code seems like a redundant, dirty hack. I decided to remove it completely
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.
You can't just remove a piece of functionality that you don't understand. This code has a precise meaning:
Sync focus state between the grid component and the grid model. Now it's impossible to manipulate the focus from the model, and probably it broke functionality based on it (value panel, row add/duplicate)
| focusSyncRef.current = { colIdx, rowIdx }; | ||
| 
               | 
          ||
| this.selectCell({ colIdx, rowIdx }); | ||
| }, | 
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.
Not in use anywhere. Only in the deleted piece below, so I removed it also
| return () => { | ||
| tableData.editor.action.removeHandler(syncEditor); | ||
| }; | ||
| }, [tableData.editor, selectionAction, handlers, tableData, restoreFocus]); | 
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.
You can't just remove a piece of functionality that you don't understand. This code has a precise meaning:
Sync focus state between the grid component and the grid model. Now it's impossible to manipulate the focus from the model, and probably it broke functionality based on it (value panel, row add/duplicate)
closes https://github.com/dbeaver/pro/issues/6859
Changes:
columnIdlogic. Now we have two types of IDs.Visual column idrepresents the column number on the screen. AnddataColIdx, which means the column index in the initial columns array provided to the data gridvisual column ID, some need to usedataColIdx. So used it respectively where required