Enable view-based NSTableViews to reload entire rows#138
Merged
Conversation
…t the first column in the row, when an element is updated.
Owner
|
Sorry for my late response. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Checklist
Description
When an
NSTableViewhas view-based cells (e.g.NSTableViewDelegate'stableView(_:viewFor:row:)is implemented, rather than justNSTableViewDataSource'stableView(_:objectValueFor:row)), its behaviour whenreloadData(forRowIndexes:columnIndexes)is called changes.When cell values are only derived from
tableView(_:objectValueFor:row), a reload call with any set ofcolumnIndexeswill lead to the whole row being refreshed. When the delegate method above is implemented, only the columns of that row directly addressed by thecolumnIndexesargument are reloaded.The current code in the AppKit extension always passes a
columnIndexesargument of[0]1, which therefore only updates the 0th column's cell in any row to which the reload is applied.My change explicitly adds all valid column indexes to the reloadData call, so that an entire row is refreshed when its associated data element is updated.
Related Issue
I can raise one with the above observations if it's deemed necessary.
Motivation and Context
I was motivated by the fact that my NSTableView wouldn't properly refresh. Apologies for not adding documentation or tests but this particular extension lacks these in the first place.
Impact on Existing Code
I can see no negative impact on existing code, and no risk to the core algorithm since my changes are limited to the AppKit extension.
Screenshots (if appropriate)
Footnotes
or more accurately of the element's
sectionvalue, which seems to be an oversight. ↩