run macro on jsl data

This commit is contained in:
Jan Prochazka
2023-02-24 16:48:37 +01:00
parent 6ff4acc50d
commit d024b6f25c
6 changed files with 59 additions and 16 deletions

View File

@@ -214,7 +214,8 @@ export function runMacroOnChangeSet(
macroArgs: {},
selectedCells: MacroSelectedCell[],
changeSet: ChangeSet,
display: GridDisplay
display: GridDisplay,
useRowIndexInsteaOfCondition: boolean
): ChangeSet {
const errors = [];
const compiledMacroFunc = compileMacroFunction(macro, errors);
@@ -222,7 +223,13 @@ export function runMacroOnChangeSet(
let res = changeSet;
for (const cell of selectedCells) {
const definition = display.getChangeSetField(cell.rowData, cell.column, undefined);
const definition = display.getChangeSetField(
cell.rowData,
cell.column,
undefined,
useRowIndexInsteaOfCondition ? cell.row : undefined,
useRowIndexInsteaOfCondition
);
const macroResult = runMacroOnValue(
compiledMacroFunc,
macroArgs,