Hide disable sort on a column linked by rowsGroup

Hide disable sort on a column linked by rowsGroup

holpotholpot Posts: 1Questions: 1Answers: 0
edited April 7 in Plug-ins

I have table with a checkbox for download in the first column, a filename in the second, and various file contents in the rest. Many rows have the same file name, so I used the rowsGroup plugin to collapse them so its only written out once.

But I need the checkboxes to collapse down too (I cant have multiple download checkboxes for one filename). To achieve this I added column 0 to rowsGroup to tie them together ("rowsGroup": [1,0]). But now its impossible to disable sorting on the first column or to remove the sort icon from it (see attachment).

   $('#results').DataTable({
 "scrollY" :"400px",
"paging": false,
  "scrollCollapse": true,
 "order": [[ 1, "desc" ]],
    "aoColumns": [
    { "bSortable": false, "aTargets":[0]},
    { "bSortable": true },
    { "bSortable": true },
    { "bSortable": true },
    { "bSortable": true },
    { "bSortable": true },
    { "bSortable": true },
    { "bSortable": true },
    { "bSortable": true },
    { "bSortable": true },
    { "bSortable": true },
    { "bSortable": true },
    { "bSortable": true },
    { "bSortable": false }
],
  "columnDefs": [
    { orderable: false, targets: 0 }
  ],
 "rowsGroup": [1,0],
  dom: 'Bfrtip',
        buttons: [
            'colvis'
        ]
}
);

I could just put the checkbox in the same <td> as the filename but then it cant sort on it.

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • colincolin Posts: 11,280Questions: 0Answers: 1,927

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

Sign In or Register to comment.