fisclimate#1348: Add column attributes #30
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.
This PR cleans up the Column attributes a bit.
Currently, Column attributes are configured via initialization parameters, which results in Columns being created and configured similarly to the following:
This method works, but it's not clear what configuration options are being changed and when. Have we customized the default
can_sort
value, or isFalse
the default value inColumn
?By switching to a system based on class attributes, Column configuration becomes much simpler:
Here we can clearly see that we are customizing the
can_sort
andlink_label
attributes.It should be noted that this is likely a breaking change. Applications using the webgrid library will likely need to be updated to use the new class attributes instead of the initialization parameters. The version number has been bumped a minor revision to help indicate this change.