#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. 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 ### Custom columns
It is possible to reorder, extend or completely redefine data columns displayed by the component. 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" <alfresco-document-menu-action *ngIf="creationMenuActions"
[currentFolderPath]="currentFolderPath" [currentFolderPath]="currentFolderPath"
(onSuccess)="onActionMenuSuccess($event)" (success)="onActionMenuSuccess($event)"
(onError)="onActionMenuError($event)"> (error)="onActionMenuError($event)">
</alfresco-document-menu-action> </alfresco-document-menu-action>
<alfresco-datatable <alfresco-datatable
[data]="data" [data]="data"

View File

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