Disallow selection on first and last column.
Disallow selection on first and last column.
Link to test case: n/a
Debugger code (debug.datatables.net): n/a
Error messages shown: n/a
Description of problem: I'm trying to figure out how to disable the row selection on the first and last column. I can successfully disable it on either but not both.
Referencing the docs here: https://datatables.net/reference/option/select.selector
select: {
style: 'single',
selector: 'td:not(:last-child)' // no row selection on last column
},
OR
select: {
style: 'single',
selector: 'td:not(:first-child)' // no row selection on first column
},
Both of these work as expected but I want to combine them. I have tried:
select: {
style: 'single',
selector: 'td:not(:first-child), td:not(:last-child)'
},
but that breaks it completely. What am I missing, any thoughts? Thanks!
This question has accepted answers - jump to:
Answers
How about this:
http://live.datatables.net/begecowu/1/edit
Kevin
Amazing. Thanks for the help!
Hi again,
What if I also wanted to disallow selection for a row with a certain style like:
Basically, I want to combine my previous request and this. So something like:
You can combine those into a single selector:
See Ashton Cox in the example here, the class is set in the HTML,
Colin
Absolutely incredible. Thank you very much!