mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5034] [GroupCloudComponent] Provide a way to make pre-selected groups read-only. (#5306)
* Added readonly property to the IdentityGroupModel. * Updated unit tests. * Changed class to interface. * Updated doc
This commit is contained in:
committed by
Maurizio Vitale
parent
c01f2744b6
commit
cc4c9bc567
@@ -92,3 +92,35 @@ export class MyComponent {
|
||||
[preSelectGroups]="groups">
|
||||
</adf-cloud-group>
|
||||
```
|
||||
|
||||
### Read-only
|
||||
|
||||
You can use `readonly` property to make preselected groups read-only in `multiple` mode.
|
||||
|
||||
Usage example:
|
||||
|
||||
```ts
|
||||
import { ObjectDataTableAdapter } from '@alfresco/adf-core';
|
||||
|
||||
@Component({...})
|
||||
export class MyComponent {
|
||||
groups: any;
|
||||
|
||||
constructor() {
|
||||
this.groups =
|
||||
[
|
||||
{id: 1, name: 'Group 1', readonly: true},
|
||||
{id: 2, name: 'Group 2', readonly: false}
|
||||
];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```html
|
||||
<adf-cloud-group
|
||||
[mode]="'multiple'"
|
||||
[preSelectGroups]="groups">
|
||||
</adf-cloud-group>
|
||||
```
|
||||
|
||||
from above `preSelectGroups`, `Group 2` is removable from the `preSelectGroups` whereas `Group 1` is readonly you can not remove them.
|
||||
|
Reference in New Issue
Block a user