Browse Source

fix(gui): trigger initial data load from grid

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3655/head
Pranav C 2 years ago
parent
commit
3209b551c6
  1. 3
      packages/nc-gui/components/smartsheet/Grid.vue
  2. 6
      packages/nc-gui/composables/useViewSorts.ts

3
packages/nc-gui/components/smartsheet/Grid.vue

@ -411,6 +411,9 @@ const expandedFormOnRowIdDlg = computed({
// reload table data reload hook as fallback to rowdatareload
provide(ReloadRowDataHookInj, reloadViewDataHook)
// trigger initial data load in grid
reloadViewDataHook.trigger()
</script>
<template>

6
packages/nc-gui/composables/useViewSorts.ts

@ -37,6 +37,7 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
if (isPublic.value || isSharedBase.value) {
sorts.value[i] = sort
sorts.value = [...sorts.value]
reloadHook?.trigger()
return
}
@ -75,6 +76,7 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
sorts.value.splice(i, 1)
sorts.value = [...sorts.value]
reloadHook?.trigger()
$e('a:sort:delete')
} catch (e: any) {
console.error(e)
@ -82,9 +84,5 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
}
}
watch(sorts, () => {
reloadHook?.trigger()
})
return { sorts, loadSorts, addSort, deleteSort, saveOrUpdate }
}

Loading…
Cancel
Save