group()
group<
RG>(query:RG,sourcePathOrID:string|Path,targetPathOrID:string|Path,__namedParameters:GroupOptions):RG
Defined in: packages/core/src/utils/queryTools.ts:620
Creates a new group at a target path with its rules array containing the current
objects at the target path and the source path. In the options parameter, pass
{ clone: true } to copy the source rule/group instead of move.
Type Parameters
| Type Parameter |
|---|
RG extends RuleGroupTypeAny |
Parameters
| Parameter | Type | Description |
|---|---|---|
query | RG | The query to update. |
sourcePathOrID | string | Path | Path of the rule/group to move or clone. |
targetPathOrID | string | Path | Path of the target rule/group, which will become the path of the new group. |
__namedParameters | GroupOptions | Options. |
Returns
RG
The new query with the rules or groups grouped.
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.