Sorting by a 'checked' column?

Sorting by a 'checked' column?

vsekvsek Posts: 30Questions: 17Answers: 0

Hello, I have a column that is a check box on column 0. So I did this code in hopes of sorting first by column zero(the checkbox) and column 2. It sorts fine by column 2 but never for the check box one. Is there a way to sort the way I want?

    var standardDataTable = $(dataTableId).DataTable({
        ajaxSource : "/cma/contents/screening/restrictedEntityGroupDetails_data?groupName=<%= (String)request.getAttribute("groupName")%>", 
        dom: 'Bfrtip', 
        buttons: [ 
              'copy', 'excel', 'pdf', 'searchBuilder'
           ],
           'columnDefs': [
                {
                 'targets': 0, 
                 'checkboxes': {
                 'selectRow': true
                             },
                 'createdCell':  function (td, cellData, rowData, row, col){
                    if(rowData[0] === 'x')
                    {this.api().cell(td).checkboxes.select();}
            }
          }

        ],
        'select': {
            'style': 'single'
         },
        'order': [[0, 'asc'], [ 2, 'asc' ]] 
    });     

Answers

This discussion has been closed.