mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
support for toggling custom context menu (#1683)
* support for toggling custom context menu * fix unit tests
This commit is contained in:
committed by
Mario Romano
parent
4ca18bc8f9
commit
2e44550d7f
@@ -103,7 +103,6 @@ Usage example of this component :
|
||||
**my.component.ts**
|
||||
|
||||
```ts
|
||||
|
||||
import { NgModule, Component } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
@@ -155,17 +154,14 @@ export class DataTableDemo {
|
||||
imports: [
|
||||
BrowserModule,
|
||||
CoreModule.forRoot(),
|
||||
DataTableModule
|
||||
DataTableModule.forRoot()
|
||||
],
|
||||
declarations: [DataTableDemo],
|
||||
bootstrap: [DataTableDemo]
|
||||
})
|
||||
export class AppModule {
|
||||
}
|
||||
export class AppModule {}
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
|
||||
|
||||
```
|
||||
|
||||

|
||||
@@ -179,6 +175,7 @@ platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
| `actions` | boolean | false | Toggles data actions column |
|
||||
| `actionsPosition` | string (left\|right) | right | Position of the actions dropdown menu. |
|
||||
| `fallbackThumbnail` | string | | Fallback image for row ehre thubnail is missing|
|
||||
| `contextMenu` | boolean | false | Toggles custom context menu for the component |
|
||||
|
||||
### Events
|
||||
|
||||
|
@@ -67,7 +67,8 @@
|
||||
class="mdl-data-table__cell--non-numeric non-selectable data-cell {{col.cssClass}}"
|
||||
(click)="onRowClick(row, $event)"
|
||||
(dblclick)="onRowDblClick(row, $event)"
|
||||
[context-menu]="getContextMenuActions(row, col)">
|
||||
[context-menu]="getContextMenuActions(row, col)"
|
||||
[context-menu-enabled]="contextMenu">
|
||||
<div *ngIf="!col.template">
|
||||
<div *ngSwitchCase="'image'" class="cell-value">
|
||||
<i *ngIf="isIconValue(row, col)" class="material-icons icon-cell">{{asIconValue(row, col)}}</i>
|
||||
|
@@ -45,6 +45,9 @@ export class DataTableComponent implements OnInit {
|
||||
@Input()
|
||||
fallbackThumbnail: string;
|
||||
|
||||
@Input()
|
||||
contextMenu: boolean = false;
|
||||
|
||||
@Output()
|
||||
rowClick: EventEmitter<DataRowEvent> = new EventEmitter<DataRowEvent>();
|
||||
|
||||
|
Reference in New Issue
Block a user