【发布时间】:2017-01-12 06:56:47
【问题描述】:
我将 ag-grid 包装在一个 ng2 组件中。
我希望第一个标题是具有父功能的复选框。
如何从容器组件中做到这一点?
ag-grid.component
@Component({
moduleId: module.id,
selector: 'rg-grid',
templateUrl: 'grid-control.component.html',
directives: [AgGridNg2]
})
export class RgGridComponent {
private gridOptions: GridOptions;
private showGrid: boolean;
@Input() rowData: any[];
@Input() columnDefs: AbstractColDef[];
}
容器组件
@Component({
moduleId: module.id,
selector: 'alerts-table',
templateUrl: 'alertsTable.component.html',
directives: [RgGridComponent]
})
export class AlertsTableComponent implements OnInit {
selectedAlert: IAlert;
users: User[];
checkedAlerts : IAlert[];
displayDialog : boolean;
dialogContent : string;
columns : ColDef[];
constructor(private _alertsService: AlertsService, private _usersService: UsersService) {
this.displayDialog = false;
this.investigationRequest = new EventEmitter<number>();
this.columns = [ ??? ]
this.checkedAlerts = new Array<Alert>();
}
【问题讨论】: