Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork134
Added formatter to column object#303
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
constcolumn=props.columns![idx]; | ||
constvalue=item[colName]; | ||
returntypeofcolumn==="object"&&column.formatter | ||
?column.formatter(value) | ||
:value; |
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.
I know that there may be better ways, but that would need quite a bit of code-change.
This was tested with a rather big table, and no perf-problems did occur, so I'm fine with this approach.
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions |
When the project owner would have a look, then there could be some activity. |
The table data items are displayed by simple
toString
(internally).This PR adds the optional property
formatter
, so you can do something likein order to specify aformatter, that will convert each item's property according the given formatter-function.
Note
It's optional to specify the
formatter