mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 05:58:55 +08:00
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:
parent
cf140e0db1
commit
027c63fd84
@ -31,6 +31,7 @@ const ExtensionDataTable = ({table}) => {
|
||||
deferRender: true,
|
||||
columns: data.columns,
|
||||
data: data.data,
|
||||
pagingType: "numbers",
|
||||
order: [[1, "desc"]]
|
||||
}
|
||||
return (
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user