mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-05 14:26:06 +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() {
|
||||
columnSizing.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']);
|
||||
}
|
||||
|
||||
|
||||
@@ -200,7 +200,8 @@ export const createColumns = ({
|
||||
enableHiding: true,
|
||||
meta: {
|
||||
label: () => t('table.playerList.photonId'),
|
||||
disableVisibilityToggle: true
|
||||
disableVisibilityToggle: true,
|
||||
defaultHidden: true
|
||||
},
|
||||
sortingFn: (rowA, rowB) =>
|
||||
(rowA.original?.photonId ?? 0) - (rowB.original?.photonId ?? 0),
|
||||
|
||||
Reference in New Issue
Block a user