Add column formatters for the datatable component#530
Merged
Conversation
If string entries are longer than 24 characters they'll be shorten and end with "...". Furthermore, I removed the "simphonyproject/" suffix of the application names.
Member
Author
|
Maybe we should add a tooltip to display the complete identifier/name when the mouse is over it ? |
Codecov Report
@@ Coverage Diff @@
## master #530 +/- ##
=======================================
Coverage 95.18% 95.18%
=======================================
Files 85 85
Lines 3905 3905
Branches 247 247
=======================================
Hits 3717 3717
Misses 137 137
Partials 51 51Continue to review full report at Codecov.
|
Contributor
|
simphonyproject should stay |
Member
Author
|
Need some tests |
martinRenou
commented
Jul 5, 2017
| <template v-for="(value, col_index) in row"> | ||
| <td v-if="isBoolean(value)"><i class="fa fa-check" v-if="value"></i></td> | ||
| <td v-else>{{value}}</td> | ||
| <td v-html="columnFormatters[col_index] !== undefined ? columnFormatters[col_index](value) : value"></td> |
Member
Author
There was a problem hiding this comment.
check if it's a function.
| "headers", "rows", "globalActions", "rowActions" | ||
| ], | ||
| props: { | ||
| headers: { type: Array, default: () => {return [];} }, |
| props: { | ||
| headers: { type: Array, default: () => {return [];} }, | ||
| columnFormatters: { type: Array, default: () => {return [];} }, | ||
| rows: { type: Array, default: () => {return [];} }, |
Member
Author
There was a problem hiding this comment.
i would be tempted to say it must also be mandatory, at least as model object from outside.
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.
Add
columFormattersprop to the datatable component. This prop is an array of functions (formatters) which takes the value of the table as input and returns a string representing some html or plain text. This html output will be used to represent the data in the datatable.Those formatters are used to shorten ids in the containersView and to represent boolean values in the accountingView.
Closes #476