Browse Source

fix(extensions): url-preview: emit event from `<InfiniteTable/>`

pull/9793/head
amandesai01 2 weeks ago
parent
commit
d453914d4b
  1. 13
      packages/nc-gui/components/smartsheet/grid/InfiniteTable.vue

13
packages/nc-gui/components/smartsheet/grid/InfiniteTable.vue

@ -258,7 +258,7 @@ const updateVisibleRows = async () => {
const firstChunkId = Math.floor(start / CHUNK_SIZE)
const lastChunkId = Math.floor((end - 1) / CHUNK_SIZE)
const chunksToFetch = new Set()
const chunksToFetch = new Set<number>()
for (let chunkId = firstChunkId; chunkId <= lastChunkId; chunkId++) {
if (!chunkStates.value[chunkId]) chunksToFetch.add(chunkId)
@ -1399,6 +1399,17 @@ eventBus.on(async (event, payload) => {
}
})
watch(activeCell, (activeCell) => {
const row = activeCell.row !== null ? cachedRows.value.get(activeCell.row)?.row : undefined;
const col = (row && activeCell.col !== null) ? fields.value[activeCell.col] : undefined;
const val = (row && col) ? row[col.title as string] : undefined;
const rowId = extractPkFromRow(row!, meta.value?.columns as ColumnType[])
const viewId = view.value?.id;
eventBus.emit(SmartsheetStoreEvents.CELL_SELECTED, { rowId, colId: col?.id, val, viewId });
})
const reloadViewDataHookHandler = async () => {
// If the scroll Position is not at the top, scroll to the top
// This always loads the first page of data when the view data is reloaded

Loading…
Cancel
Save