Skip to content

Commit 9f9f741

Browse files
committed
Remove the table header as well
when destroying the datatable object Fixes #363
1 parent 93cde95 commit 9f9f741

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/itables_for_dash/src/lib/fragments/ITable.react.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useState, useRef, useCallback } from "react";
2-
import DataTable from "dt_for_itables";
2+
import { DataTable, jQuery} from "dt_for_itables";
33
import { defaultProps, propTypes } from '../components/ITable.react.js';
44
import "dt_for_itables/dt_bundle.css";
55

@@ -50,7 +50,8 @@ const ITable = (props) => {
5050
}
5151

5252
console.debug("Destroying DataTable(id='%s')", id);
53-
dtInstance.current.clear().destroy();
53+
dtInstance.current.destroy();
54+
jQuery("#".concat(id)).empty();
5455
dtInstance.current = null;
5556
}
5657
}

0 commit comments

Comments
 (0)