# Class PageGroup

PageGroup class This is a collection of pages that can be requested like a normal page. Each member of the group has an eligibility formula, and the first page whose eligibility formula matches is shown. This can be used to show different pages on different devices.

#### Hierarchy

- PageGroup

#### Implements

- AbstractPageGroup

- Defined in saltcorn-data/models/page_group.ts:25
- Defined in saltcorn-data/models/page_group.ts:343

#####
Index

### Constructors

constructor

### Properties

description?
id?
members
min_role
name
random_allocation

### Methods

addMember
clearMembers
clone
connected_objects
delete
findMember
getEligiblePage
loadPages
moveMember
removeMember
sortedMembers
create
delete
find
findOne
update

## Constructors

### constructor

- new PageGroup(cfg): PageGroup

- #### Parameters

  - ##### cfg: PageGroupCfg

  #### Returns PageGroup

  - Defined in saltcorn-data/models/page_group.ts:32

## Properties

### `Optional` description

description?: string

Implementation of AbstractPageGroup.description

- Defined in saltcorn-data/models/page_group.ts:28

### `Optional` id

id?: number

Implementation of AbstractPageGroup.id

- Defined in saltcorn-data/models/page_group.ts:26

### members

members: AbstractPageGroupMember[]

Implementation of AbstractPageGroup.members

- Defined in saltcorn-data/models/page_group.ts:29

### min_role

min_role: number

Implementation of AbstractPageGroup.min_role

- Defined in saltcorn-data/models/page_group.ts:30

### name

name: string

Implementation of AbstractPageGroup.name

- Defined in saltcorn-data/models/page_group.ts:27

### random_allocation

random_allocation: boolean

Implementation of AbstractPageGroup.random_allocation

- Defined in saltcorn-data/models/page_group.ts:31

## Methods

### addMember

- addMember(cfg): Promise<PageGroupMember>

- add a member to this group

  #### Parameters

  - ##### cfg: PageGroupMemberCfg

  #### Returns Promise<PageGroupMember>

  - Defined in saltcorn-data/models/page_group.ts:285

### clearMembers

- clearMembers(): Promise<void>

- clear all members from this group

  #### Returns Promise<void>

  - Defined in saltcorn-data/models/page_group.ts:310

### clone

- clone(): Promise<PageGroup>

- duplicate this group with a new name

  #### Returns Promise<PageGroup>

  the created group

  - Defined in saltcorn-data/models/page_group.ts:261

### connected_objects

- connected_objects(): ConnectedObjects

- #### Returns ConnectedObjects

  - Defined in saltcorn-data/models/page_group.ts:337

### delete

- delete(): Promise<void>

- delete this group

  #### Returns Promise<void>

  - Defined in saltcorn-data/models/page_group.ts:252

### findMember

- findMember(where): AbstractPageGroupMember[]

- find a member

  #### Parameters

  - ##### where: any

  #### Returns AbstractPageGroupMember[]

  - Defined in saltcorn-data/models/page_group.ts:332

### getEligiblePage

- getEligiblePage(data, user, locale?): Promise<null | Page>

- determine the first page in the group that matches the client screen size

  #### Parameters

  - ##### data: ScreenInfoParams

    client screen and window size

  - ##### user: any

    the user or just { role_id: 100 }

  - ##### `Optional` locale: string

  #### Returns Promise<null | Page>

  the matching page, or null

  - Defined in saltcorn-data/models/page_group.ts:50

### loadPages

- loadPages(): Promise<Page[]>

- #### Returns Promise<Page[]>

  - Defined in saltcorn-data/models/page_group.ts:118

### moveMember

- moveMember(member, mode): Promise<void>

- manipulate the sequence of a member

  #### Parameters

  - ##### member: AbstractPageGroupMember

  - ##### mode: "Up" | "Down"

  #### Returns Promise<void>

  - Defined in saltcorn-data/models/page_group.ts:91

### removeMember

- removeMember(id): Promise<void>

- remove a member from this group

  #### Parameters

  - ##### id: number

    id of the member

  #### Returns Promise<void>

  - Defined in saltcorn-data/models/page_group.ts:321

### sortedMembers

- sortedMembers(): AbstractPageGroupMember[]

- #### Returns AbstractPageGroupMember[]

  the members sorted by sequence

  - Defined in saltcorn-data/models/page_group.ts:114

### `Static` create

- create(cfg): Promise<PageGroup>

- create a new group and add members

  #### Parameters

  - ##### cfg: PageGroupCfg

  #### Returns Promise<PageGroup>

  the created group

  - Defined in saltcorn-data/models/page_group.ts:187

### `Static` delete

- delete(where): Promise<void>

- delete a group

  #### Parameters

  - ##### where: number | Where

  #### Returns Promise<void>

  - Defined in saltcorn-data/models/page_group.ts:223

### `Static` find

- find(where?, selectopts?): Promise<PageGroup[]>

- find groups

  #### Parameters

  - ##### `Optional` where: Where

  - ##### selectopts: SelectOptions = ...

  #### Returns Promise<PageGroup[]>

  an array of page groups

  - Defined in saltcorn-data/models/page_group.ts:132

### `Static` findOne

- findOne(where): null | PageGroup

- find one group

  #### Parameters

  - ##### where: Where

  #### Returns null | PageGroup

  one page group or null

  - Defined in saltcorn-data/models/page_group.ts:170

### `Static` update

- update(id, row): Promise<void>

- update a group

  #### Parameters

  - ##### id: number

    id of the group

  - ##### row: Row

    values to update

  #### Returns Promise<void>

  - Defined in saltcorn-data/models/page_group.ts:213

Generated using TypeDoc