#384 Rename event name and improve docs

This commit is contained in:
mauriziovitale84 2016-12-13 10:26:37 +00:00
parent 369ac0d7d6
commit d950612738
5 changed files with 24 additions and 7 deletions

View File

@ -210,6 +210,23 @@ DocumentList provides simple breadcrumb element to indicate the current position
Parent folder button is not displayed when breadcrumb is enabled.
### Creation Menu Action
DocumentList provides simple creation menu actions that provide the action to create a new folder.
```html
<alfresco-document-menu-action
[currentFolderPath]="currentFolderPath">
</alfresco-document-menu-action>
```
![Creation Menu Action](docs/assets/document-list-creation-menu-actions-1.png)
When the "New Folder" button is pressed a dialog appear.
![Creation Menu Action](docs/assets/document-list-creation-menu-actions-2.png)
### Custom columns
It is possible to reorder, extend or completely redefine data columns displayed by the component.

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

View File

@ -1,7 +1,7 @@
<alfresco-document-menu-action *ngIf="creationMenuActions"
[currentFolderPath]="currentFolderPath"
(onSuccess)="onActionMenuSuccess($event)"
(onError)="onActionMenuError($event)">
(success)="onActionMenuSuccess($event)"
(error)="onActionMenuError($event)">
</alfresco-document-menu-action>
<alfresco-datatable
[data]="data"

View File

@ -43,10 +43,10 @@ export class DocumentMenuAction implements OnInit {
currentFolderPath: string;
@Output()
onSuccess = new EventEmitter();
success = new EventEmitter();
@Output()
onError = new EventEmitter();
error = new EventEmitter();
@ViewChild('dialog')
dialog: any;
@ -73,16 +73,16 @@ export class DocumentMenuAction implements OnInit {
res => {
let relativeDir = this.currentFolderPath;
console.log(relativeDir);
this.onSuccess.emit({value: relativeDir});
this.success.emit({value: relativeDir});
},
error => {
let errorMessagePlaceholder = this.getErrorMessage(error.response);
if (errorMessagePlaceholder) {
this.message = this.formatString(errorMessagePlaceholder, [name]);
this.onError.emit({message: this.message});
this.error.emit({message: this.message});
console.log(this.message);
} else {
this.onError.emit(error);
this.error.emit(error);
console.log(error);
}
}