You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within a Shiny app, I wish to remove the all/none check box from a Reactable table because I wish to limit the number of checkboxes allowed.
With the generous help of Stackoverflow I have a solution. That involves waiting a fixed amount of time and then removing the all/none checkbox. This works well unless the page takes an unusually long time to load. Then it will fail.
The author of the solution, Abdessabour Mtk, explains it thus:
I tried the event handling way, but shiny somehow fails to call them on the first occurence. And "DOMContentLoaded" fails because it's fired before the loading of the content.
I am wondering if there is a more reliable way to remove the check all/none check box?
This might be supported out-of-the-box if selection columns ever support custom rendering (#82 (comment)), but for now, you'll probably have to hack it in.
That JavaScript solution looks really fragile to me. I think I would recommend hiding the "select all" checkbox using CSS instead, so that the checkbox is still there but hidden and non-interactable.
I would use either a reactableTheme() or regular CSS to:
Style the selection column header checkbox with display: none to hide the checkbox
Style the selection column header cell with pointer-events: none to disable clicking on the cell. (The entire cell can be clicked to toggle selection, not just the checkbox.)
Within a Shiny app, I wish to remove the all/none check box from a Reactable table because I wish to limit the number of checkboxes allowed.
With the generous help of Stackoverflow I have a solution. That involves waiting a fixed amount of time and then removing the all/none checkbox. This works well unless the page takes an unusually long time to load. Then it will fail.
The author of the solution, Abdessabour Mtk, explains it thus:
I am wondering if there is a more reliable way to remove the check all/none check box?
Example Code
The text was updated successfully, but these errors were encountered: