How to exclude first column (select checkbox) from columnControl where target is tfoot?
How to exclude first column (select checkbox) from columnControl where target is tfoot?
Mwhite007
Posts: 15Questions: 5Answers: 0
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
This question has an accepted answers - jump to answer
Answers
Just as shown in this example. Have the content for the target column as an empty array.
If that doesn't help, please show your current configuration.
Allan
i tried that... the javascript
columnControl block looks like this:
and the columnDef looks like this:
also, i am using jQuery 4.0.0, Bootstrap 5.3x, DataTables 2.3.7
if you care about the html tfoot code:
I also tried combining the columnDef section like this:
The
columnDefs.targetonly seems to work whencolumnControl.targetis not used, for example:https://live.datatables.net/keforuwi/1/edit
However specifying either
theadlike this:https://live.datatables.net/futukabo/1/edit
or
tfootlike this:https://live.datatables.net/geludixo/1/edit
columnDefs.targetdoesn't not work.@allan will need to take a look.
Kevin
Unless Allan has a quick fix, as a workaround, you could use
ready()end remove the ColumnControlspancreated in the first column, something like this:For example:
https://live.datatables.net/mafohava/1/edit
Kevin
Ah! If you don't specify a
columnControl.targetthen it will assume the default. The key here is that:is actually just a shorthand for:
So if you are telling the top level
columnControlto position in a target other than the default, then you also need to tell the column specific configuration the same:While this might seems like an extra complication for the configuration this is method to the madness
. Doing it this way means that you can have the header and the footer (and any rows inside them) defined with their own configuration.
Regards,
Allan
@allan I may have missed it but didn't see anything in the docs or examples that explained this. Can this be added to the documentation and/or examples?
Kevin
Good point! I've made it explicit in the docs. It is on the
dt3branch, but I hope to merge that to master in the not too distant future.Allan