</eg-grid-column>
<eg-grid-column name="owner_label" [flex]="4"
[cellTemplate]="locationTemplate" [cellContext]="gridTemplateContext"
+ [cellPrintValue]="cellPrintValues"
label="Location/Barcode" [disableTooltip]="true" i18n-label>
</eg-grid-column>
<eg-grid-column path="callNumCount" datatype="number" label="Call Numbers" i18n-label>
<eg-grid-column i18n-label label="Deposit Amount" path="copy.deposit_amount"
name="deposit_amount" datatype="money" [hidden]="true"></eg-grid-column>
<eg-grid-column i18n-label label="Holdable?" name="holdable"
- [cellTemplate]="holdableTemplate" [cellContext]="gridTemplateContext">
+ [cellTemplate]="holdableTemplate" [cellContext]="gridTemplateContext"
+ [cellPrintValue]="cellPrintValues">
</eg-grid-column>
<eg-grid-column i18n-label label="Reference?" path="copy.ref"
name="ref" datatype="bool" [hidden]="true"></eg-grid-column>
import {OrgService} from '@eg/core/org.service';
import {PcrudService} from '@eg/core/pcrud.service';
import {AuthService} from '@eg/core/auth.service';
-import {GridDataSource} from '@eg/share/grid/grid';
+import {GridDataSource, GridColumn} from '@eg/share/grid/grid';
import {GridComponent} from '@eg/share/grid/grid.component';
import {GridToolbarCheckboxComponent
} from '@eg/share/grid/grid-toolbar-checkbox.component';
renderFromPrefs: boolean;
rowClassCallback: (row: any) => string;
+ cellPrintValues: (row: any, cell: GridColumn) => string;
private _recId: number;
@Input() set recordId(id: number) {
}
};
+ // Text-ify function for cells that use display templates.
+ this.cellPrintValues = (row: any, cell: GridColumn): string => {
+ switch (cell.name) {
+ case 'owner_label':
+ return row.locationLabel;
+ case 'holdable':
+ return row.copy ?
+ this.gridTemplateContext.copyIsHoldable(row.copy) :
+ '';
+ }
+ };
+
this.gridTemplateContext = {
toggleExpandRow: (row: HoldingsEntry) => {
row.treeNode.expanded = !row.treeNode.expanded;