<b-table> mark rows as unselectable
See original GitHub issueIn my application the table serves both to display data and allow the “owner” of the data to the change the state of the rows by selecting them and then clicking a button. However some rows are in a state which allowing them to be changed doesn’t make sense.
It would be great if the row object could specify a _selectable
boolean (like _showDetails
) which enable/disable the ability to select the row. (If the row is in a range being selected, it is just omitted from the range).
You’d also have to decide how to handle the row being clicked with range
mode (do nothing? select all the rows up to but not including the row?).
I’m sure there’s a workaround where I listen for clicks and then conditionally deselect the row immediately, so consider this low priority.
I also understand if this is too niche to justify the complexity.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top GitHub Comments
I did a very short solution based on @sandrovw64 's solution above.
After adding the _rowVariant, which will appear as a class in each
.table-row-disabled { pointer-events: none !important; }
For those who needs a disabled row in a
<b-table>
, here is my implementation:And then, in my custom
table.scss
file I addedNotice the
.table-hover
class. My b-table is set to hover. If yours is not, then just use.table
Top Results From Across the Web
Top Related Medium Post
Top Related StackOverflow Question
Troubleshoot Live Code
Top Related Reddit Thread
Top Related Hackernoon Post
Top Related Tweet
Top Related Dev.to Post
Top Related Hashnode Post
Can't apply aria-labelledby to <b-form-checkbox>
<b-modal> @change event not triggering if the modal visible closed immediately