Hi community!
I have a datatable in my Dash app which has row selection enabled. The rows of the datatable are categorised into sets of four
With the row selection enabled all the rows get the radio button for selecting row at the left side. Is it possible to hide the row selection input for the other rows (keep the selection input visible for every fourth row which has a value in the column next to it)
Is there any hack or workarounds to achieve this?
Hello @dataturnsmeon,
Yes, you can use css to achieve this. However… with sorting and filtering, there might be issues.
It might actually be better to run a javascript code to hide them manually.
Something like this might work.
function hideRadial() {
tbl = document.getElementByClass('cell-table')[0]
rows = tbl.rows
for (y=0; y<rows.length; y++) {
if (rows[y].cells[1] == '') {
rows[y].cells[0].childNodes[0].style.display = 'none'
}
}
}
You’d just run this code once upon datatable load via a clientside_callback.
2 Likes
Thank you soo much @jinnyzor. This was super helpful !
1 Like