tdClass function does not receive the value of the formatter function in the table
See original GitHub issueDescribe the bug
I have a formatting function defined in a table column but when I create the tdClass function it does not receive that value, if not the original one
Steps to reproduce the bug
// Virtual Column
{
key: 'diff',
label: 'Diff',
class: 'text-right',
formatter: (_, __, item) => {
if (!item.duration || !item.estimatedDuration) return
const operation = item.duration - item.estimatedDuration
const decimals = 4
// Round Decimals
return (
Math.round(operation * Math.pow(10, decimals)) /
Math.pow(10, decimals)
)
},
tdClass: (value) => {
if (Math.sign(value) === 1 && value >= 1) return 'table-danger'
if (Math.sign(value) === 1 && value < 1) return 'table-warning'
return 'table-success'
},
},
Expected behavior
In my opinion, the tdClass function should return the value of the formatter function and not force me to write the contents of the formatter function again
Versions
Libraries:
- BootstrapVue: 2.15.0
- Bootstrap: 4.5.0
- Nuxt: 2.12.2
Environment:
- Device: Mac
- OS: macOS Mojave
- Browser: Chrome
- Version: 83.0.4103.97
Demo link
Not applicable
Additional context
Add any other context about the bug here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
bootstrap-vue table td element styling - Stack Overflow
You can set the tdClass property inside of your field object. But tdClass just accepts a string or an array, not an object....
Read more >Table | Components - BootstrapVue
items is the table data in array format, where each record (row) data are keyed ... The function will be called as tdClass(value,...
Read more >border-top-style - CSS: Cascading Style Sheets | MDN
This is a box with a border around it. ... Note: The specification doesn't define how borders of different styles connect in the...
Read more >Custom JQuery code targeting elements of the table is not ...
I am trying to achieve something. I have a row with two columns. In the left column, I have the tablesome table and...
Read more >How to index only part of a html log file? - Splunk Community
Section 4: Actual log file, in a table format. DB Dateand Time ALM Node Date and Time Thread Request Type Login IP Level...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It works, even there I will leave this open. Thank you
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!