<ng-template #dialogContent>
- <div class="modal-header bg-info">
+ <div class="modal-header bg-info" *ngIf="fund">
<h3 class="modal-title" i18n>Fund Details - {{fund.name()}} ({{fund.code()}} {{fund.year()}})</h3>
<button type="button" class="close"
i18n-aria-label aria-label="Close" (click)="close()">
<eg-grid #grid idlClass="{{idlClass}}" [dataSource]="dataSource" hideFields="{{hideGridFields}}"
[sortable]="true" persistKey="{{persistKey}}" autoGeneratedColumnOrder="{{fieldOrder}}"
- [filterable]="true" [stickyHeader]="true">
+ [filterable]="true" [stickyHeader]="true"
+ [cellTextGenerator]="cellTextGenerator">
<eg-grid-toolbar-button [disabled]="!canCreate"
label="New {{idlClassDef.label}}" i18n-label (onClick)="createNew()">
</eg-grid-toolbar-button>
<eg-grid-toolbar-action label="Delete Selected" i18n-label (onClick)="deleteSelected($event)">
</eg-grid-toolbar-action>
- <eg-grid-column path="name"></eg-grid-column>
+ <ng-template #nameTmpl let-row="row">
+ <a href="" (click)="openFundDetailsDialog([row]); false">
+ {{row.name()}}
+ </a>
+ </ng-template>
+ <eg-grid-column path="name" [cellTemplate]="nameTmpl"></eg-grid-column>
<eg-grid-column path="code"></eg-grid-column>
<eg-grid-column path="year"></eg-grid-column>
<eg-grid-column path="org"></eg-grid-column>
import {Component, Input, ViewChild, OnInit} from '@angular/core';
import {Location} from '@angular/common';
import {FormatService} from '@eg/core/format.service';
-import {GridDataSource} from '@eg/share/grid/grid';
+import {GridDataSource, GridCellTextGenerator} from '@eg/share/grid/grid';
import {AdminPageComponent} from '@eg/staff/share/admin-page/admin-page.component';
import {Pager} from '@eg/share/util/pager';
import {ActivatedRoute} from '@angular/router';
idlClass = 'acqf';
classLabel: string;
- @ViewChild('fundDetailsDialog', { static: true }) fundDetailsDialog: FundDetailsDialogComponent;
+ @ViewChild('fundDetailsDialog', { static: false }) fundDetailsDialog: FundDetailsDialogComponent;
+
+ cellTextGenerator: GridCellTextGenerator;
constructor(
route: ActivatedRoute,
}
ngOnInit() {
-
+ this.cellTextGenerator = {
+ name: row => row.name()
+ };
this.fieldOrder = 'name,code,year,org,active,currency_type,balance_stop_percentage,balance_warning_percentage,propagate,rollover';
this.defaultNewRecord = this.idl.create('acqf');
this.defaultNewRecord.active(true);