mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-12 15:56:00 +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,
|
deferRender: true,
|
||||||
columns: data.columns,
|
columns: data.columns,
|
||||||
data: data.data,
|
data: data.data,
|
||||||
|
pagingType: "numbers",
|
||||||
order: [[1, "desc"]]
|
order: [[1, "desc"]]
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
@ -17,6 +17,10 @@ const DataTablesTable = ({id, options}) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dataTableRef.current = new DataTable(idSelector, 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 () => {
|
return () => {
|
||||||
if (dataTableRef.current) {
|
if (dataTableRef.current) {
|
||||||
|
Loading…
Reference in New Issue
Block a user