Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

Collapse and expand row group not working when using .DataTable().clear().destroy();

$
0
0

I'm reloading my table using a dropdown with a year selection. The first time in the RowGroup expand and collapse function works. When I reload the table, that functionality is disable. Any thoughts.

The RowGroup expand and collapse function

// Expand/Collaspe Groups
  $('#timeLogTable_OutOfOffice tbody').on('click', 'tr.dtrg-start', function () {
      var pos = $('div.dataTables_scrollBody').scrollTop();
     //console.log(pos)
      var name = $(this).data('name');
      collapsedGroups[name] = !collapsedGroups[name];
      table.draw('page');
  });

The DataTable().clear().destroy(); function

function reloadOutOfOficeTable(){ 

        $("#timeLogTable_OutOfOffice").DataTable().off( 'select deselect');
        $("#timeLogTable_OutOfOffice").DataTable().clear().destroy();

        loadTable()
    }
    

Viewing all articles
Browse latest Browse all 2364

Trending Articles