Trigger window resize on datatable changes

- Also removed extension table pagination Previous and Next buttons
  to avoid overflowing if card is not wide enough

Affects issues:
- Possibly fixed #2637
This commit is contained in:
Aurora Lahtela 2022-10-15 14:25:49 +03:00
parent cf140e0db1
commit 027c63fd84
2 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,7 @@ const ExtensionDataTable = ({table}) => {
deferRender: true,
columns: data.columns,
data: data.data,
pagingType: "numbers",
order: [[1, "desc"]]
}
return (

View File

@ -17,6 +17,10 @@ const DataTablesTable = ({id, options}) => {
}
dataTableRef.current = new DataTable(idSelector, options);
// https://github.com/plan-player-analytics/Plan/issues/2637
const triggerResize = () => window.dispatchEvent(new Event('resize'));
dataTableRef.current.on('length.dt', triggerResize);
dataTableRef.current.on('search.dt', triggerResize);
return () => {
if (dataTableRef.current) {