Calculated Column
Calculated Column
shannonwrege
Posts: 22Questions: 9Answers: 0
Can you define a column which is calculated by other columns and not actually in the data set? For example, if you have a column that lists Wins (e.g. "12") and a column that lists Losses (e.g. "4"), can you have a calculated column to show in a responsive table that drops the Wins and Losses column and adds a calculated Record column (e.g. "12-4")?
This discussion has been closed.
Answers
Absolutely. There are a number of ways you can handle this.
First, how are you adding data to the table? Array of string? object? Already defined HTML table?
The answer to this question will help me provide you with the correct answer.
The data is packed in an array. The actual field values are integers, but they could be strings if it makes a difference.
So assuming your data is array of objects, I would define columns as following
If you don't want to show this combined column all the time, or only on specific resolutions, then utilize responsive classes.
Also, you will probably need a custom sort function for this combined column.
That did it. Thanks!