mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
feat: Add defaultHidden column meta property and update reset logic to hide columns
This commit is contained in:
@@ -539,7 +539,17 @@ export function useVrcxVueTable(options) {
|
|||||||
function resetAll() {
|
function resetAll() {
|
||||||
columnSizing.value = {};
|
columnSizing.value = {};
|
||||||
columnOrder.value = [];
|
columnOrder.value = [];
|
||||||
columnVisibility.value = {};
|
|
||||||
|
const cols = columnsSource.value ?? [];
|
||||||
|
const defaultHiddenVisibility = {};
|
||||||
|
for (const col of cols) {
|
||||||
|
const id = getColumnId(col);
|
||||||
|
if (id && col?.meta?.defaultHidden) {
|
||||||
|
defaultHiddenVisibility[id] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
columnVisibility.value = defaultHiddenVisibility;
|
||||||
|
|
||||||
removePersisted(['columnSizing', 'columnOrder', 'columnVisibility']);
|
removePersisted(['columnSizing', 'columnOrder', 'columnVisibility']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -200,7 +200,8 @@ export const createColumns = ({
|
|||||||
enableHiding: true,
|
enableHiding: true,
|
||||||
meta: {
|
meta: {
|
||||||
label: () => t('table.playerList.photonId'),
|
label: () => t('table.playerList.photonId'),
|
||||||
disableVisibilityToggle: true
|
disableVisibilityToggle: true,
|
||||||
|
defaultHidden: true
|
||||||
},
|
},
|
||||||
sortingFn: (rowA, rowB) =>
|
sortingFn: (rowA, rowB) =>
|
||||||
(rowA.original?.photonId ?? 0) - (rowB.original?.photonId ?? 0),
|
(rowA.original?.photonId ?? 0) - (rowB.original?.photonId ?? 0),
|
||||||
|
|||||||
Reference in New Issue
Block a user