Skip to content

Commit

Permalink
fix update table when searching in the dataframe
Browse files Browse the repository at this point in the history
  • Loading branch information
madeindjs committed Sep 19, 2024
1 parent 605f4b1 commit 8d2b5ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ui/src/components/core/content/CoreDataframe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,12 @@ async function handleSearchChange(ev: InputEvent) {
columnNames
.map((c) => `aq.op.match(d.${c}, $.pattern) !== null`)
.join(" || ");
table.value = baseTable.params({ pattern, filterS }).filter(filterS);
const aq = await import("arquero");
table.value = baseTable
.params({ pattern, filterS })
.filter(filterS)
.derive({ [ARQUERO_INTERNAL_ID]: () => aq.op.row_number() });
}
await nextTick();
resetScroll();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ export function useDataFrameValueBroker(
value: unknown,
) {
if (!table.value) throw Error("Table is not ready");
if (rowIndex === undefined)
throw Error("Must specify the index to update a row");
const eventType = "wf-dataframe-update";
const rowIndexBackend = rowIndex - 1; // 0-based index (arquero is based on 1-based index)

Expand Down

0 comments on commit 8d2b5ee

Please sign in to comment.