moveRE()
moveRE<
RE>(rulesEngine:RE,oldConditionPathOrID:string|Path,newConditionPathOrIdOrShiftDir:Path|string& { } |"up"|"down",__namedParameters:MoveOptionsRE):RE
Defined in: packages/rules-engine/src/utils/rulesEngineTools.ts:192
Moves a rule engine condition from one path to another. In the options parameter, pass
{ clone: true } to copy instead of move.
Type Parameters
| Type Parameter |
|---|
RE extends RulesEngineAny |
Parameters
| Parameter | Type | Description |
|---|---|---|
rulesEngine | RE | The rules engine to update. |
oldConditionPathOrID | string | Path | Path or ID of the condition to move, or the condition itself if moving within a nested group. |
newConditionPathOrIdOrShiftDir | Path | string & { } | "up" | "down" | Path to move the condition to, ID of the condition to replace/insert before, or shift direction. |
__namedParameters | MoveOptionsRE | Options. |
Returns
RE
The new rules engine with the condition moved or cloned.
caution
API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.