[DataTables] - DataTable should have to option to not include Checkboxes as the first column
See original GitHub issuePassing plain
to DataTable with Checkboxes in rows I am getting:
Without plain
my table looks nice, but I don’t need those checkboxes on the left:
P.S. Oh my god how brilliant is this project! It is a lifesaver! Thank you so much!
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Datatable with checkbox column and option to select or ...
Hi all, Is there anyone who have implemented a DataTable with a checkbox column and then when you tick the checkbox on the...
Read more >Responsive datatable with first column as checkbox
Trying to make the datatable as responsive, but when I tried, the checkbox in the first column is replaced with expandable icon.
Read more >How to add Checkbox in Datatable - YouTube
In this video tutorial, you will be able to add checkbox to your datatable column.
Read more >jQuery DataTables: How to add a checkbox column
In server-side processing mode ( 'serverSide':true ) elements <input type="checkbox"> would exist for current page only. Once page is changed, ...
Read more >lightning-datatable - documentation - Salesforce Developers
lightning-datatable is not supported on mobile devices. ... This example creates a table whose first column displays a checkbox for row selection.
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 Free
Top 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
Feature Request Information:
Currently, the only way to create a table without the insertion of a checkbox is to pass the
plain
prop. However, aplain
table is really used for not enforcing the height limits and thewhite-space: nowrap
enforced in a data table. This ruins the styling of any selection controls, edit dialog columns, and select field columns that appears in theplain
table.Suggested Solution
The
DataTable
component should be updated to have a new prop:selectableRows
that defaults totrue
. When rendering a row, theTableRow
component will only inject the checkbox when!this.context.plain && this.context.selectableRows
.This will allow for the data table’s styles to still be in effect.
Suggested Solution - Alt
Since there is a
.md-table-column--plain
class name created, it might be better to remove the the styles that force the.md-table-column--data
to look like a plain column when in a.md-data-table--plain
. Referenced Code. TheTableColumn
could then have aplain
prop
andcontext
that would automatically apply the plain class name. Theprops
would have a higher precedent overcontext
– ifprops.plain
is defined, use whatever value overcontext.plain
.This would allow all columns to automatically be set to
plain
when in aplain
table, and allow the developer to disable theplain
styles on specific columns.Or maybe both of these solutions should be included. 🤷♂️
I think, it is a feature, even though it is small (yet very useful for me). I am just prototyping my app, so I can wait for a proper fix released with the next update. Thank you!)