Browse Source

fix(gui-v2): allow resetting column size of newly created column

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3065/head
Pranav C 2 years ago
parent
commit
fb43daab2a
  1. 5
      packages/nc-gui-v2/composables/useGridViewColumnWidth.ts

5
packages/nc-gui-v2/composables/useGridViewColumnWidth.ts

@ -19,7 +19,7 @@ export function useGridViewColumnWidth(view: Ref<(GridType & { id?: string }) |
watch(
// todo : update type in swagger
() => [gridViewCols, resizingCol, resizingColWidth, columns],
[gridViewCols, resizingCol, resizingColWidth],
() => {
let style = ''
for (const c of columns?.value || []) {
@ -49,6 +49,9 @@ export function useGridViewColumnWidth(view: Ref<(GridType & { id?: string }) |
loadCss()
}
/** when columns changes(create/delete) reload grid columns */
watch(columns, loadGridViewColumns)
const updateWidth = (id: string, width: string) => {
if (gridViewCols?.value?.[id]) {
gridViewCols.value[id].width = width

Loading…
Cancel
Save