Add hide column option to header cell menu

This commit is contained in:
Andrew Kingston 2023-04-25 09:04:51 +01:00
parent 128411a61b
commit 45ac7d1850
1 changed files with 11 additions and 0 deletions

View File

@ -93,6 +93,16 @@
columns.actions.changePrimaryDisplay(column.name)
open = false
}
const hideColumn = () => {
columns.update(state => {
const index = state.findIndex(col => col.name === column.name)
state[index].visible = false
return state.slice()
})
columns.actions.saveChanges()
open = false
}
</script>
<div
@ -184,6 +194,7 @@
<MenuItem disabled={!canMoveRight} icon="ChevronRight" on:click={moveRight}>
Move right
</MenuItem>
<MenuItem icon="VisibilityOff" on:click={hideColumn}>Hide column</MenuItem>
</Menu>
</Popover>