[stickyHeader]="true"
[filterable]="true"
[sortable]="true"
+ [cellTextGenerator]="cellTextGenerator"
idlClass="acqinv" [dataSource]="gridSource">
<eg-grid-toolbar-action label="Print Selected Invoices" i18n-label
import {NetService} from '@eg/core/net.service';
import {AuthService} from '@eg/core/auth.service';
import {GridComponent} from '@eg/share/grid/grid.component';
-import {GridDataSource} from '@eg/share/grid/grid';
+import {GridDataSource, GridCellTextGenerator} from '@eg/share/grid/grid';
import {AcqSearchService, AcqSearchTerm, AcqSearch} from './acq-search.service';
import {AcqSearchFormComponent} from './acq-search-form.component';
noSelectedRows: (rows: IdlObject[]) => boolean;
+ cellTextGenerator: GridCellTextGenerator;
+
constructor(
private router: Router,
private route: ActivatedRoute,
ngOnInit() {
this.gridSource = this.acqSearch.getAcqSearchDataSource('invoice');
this.noSelectedRows = (rows: IdlObject[]) => (rows.length === 0);
+ this.cellTextGenerator = {
+ inv_ident: row => row.inv_ident(),
+ provider: row => row.provider().code(),
+ shipper: row => row.shipper().code(),
+ };
}
printSelectedInvoices(rows: IdlObject[]) {
[stickyHeader]="true"
[filterable]="true"
[sortable]="true"
+ [cellTextGenerator]="cellTextGenerator"
[showDeclaredFieldsOnly]="true">
<eg-grid-column path="id" [cellTemplate]="idTmpl" [disableTooltip]="true"></eg-grid-column>
import {NetService} from '@eg/core/net.service';
import {AuthService} from '@eg/core/auth.service';
import {GridComponent} from '@eg/share/grid/grid.component';
-import {GridDataSource} from '@eg/share/grid/grid';
+import {GridDataSource, GridCellTextGenerator} from '@eg/share/grid/grid';
import {AcqSearchService, AcqSearchTerm, AcqSearch} from './acq-search.service';
import {AcqSearchFormComponent} from './acq-search-form.component';
gridSource: GridDataSource;
@ViewChild('acqSearchLineitemsGrid', { static: true }) lineitemResultsGrid: GridComponent;
+ cellTextGenerator: GridCellTextGenerator;
+
constructor(
private router: Router,
private route: ActivatedRoute,
ngOnInit() {
this.gridSource = this.acqSearch.getAcqSearchDataSource('lineitem');
+ this.cellTextGenerator = {
+ id: row => row.id(),
+ title: row => {
+ const filtered = row.attributes().filter(lia => lia.attr_name() === 'title');
+ if (filtered.length > 0) {
+ return filtered[0].attr_value();
+ } else {
+ return '';
+ }
+ },
+ author: row => {
+ const filtered = row.attributes().filter(lia => lia.attr_name() === 'author');
+ if (filtered.length > 0) {
+ return filtered[0].attr_value();
+ } else {
+ return '';
+ }
+ },
+ provider: row => row.provider() ? row.provider().code() : '',
+ _links: row => '',
+ purchase_order: row => row.purchase_order() ? row.purchase_order().name() : '',
+ picklist: row => row.picklist() ? row.picklist().name() : '',
+ };
}
doSearch(search: AcqSearch) {
[stickyHeader]="true"
[filterable]="true"
[sortable]="true"
+ [cellTextGenerator]="cellTextGenerator"
idlClass="acqpl" [dataSource]="gridSource">
<eg-grid-toolbar-action label="New Selection List" i18n-label
import {AuthService} from '@eg/core/auth.service';
import {PermService} from '@eg/core/perm.service';
import {GridComponent} from '@eg/share/grid/grid.component';
-import {GridDataSource} from '@eg/share/grid/grid';
+import {GridDataSource, GridCellTextGenerator} from '@eg/share/grid/grid';
import {AcqSearchService, AcqSearchTerm, AcqSearch} from './acq-search.service';
import {PicklistCreateDialogComponent} from './picklist-create-dialog.component';
import {PicklistCloneDialogComponent} from './picklist-clone-dialog.component';
mergeNotAppropriate: (rows: IdlObject[]) => boolean;
deleteNotAppropriate: (rows: IdlObject[]) => boolean;
+ cellTextGenerator: GridCellTextGenerator;
+
constructor(
private router: Router,
private route: ActivatedRoute,
this.cloneNotAppropriate = (rows: IdlObject[]) => (!this.permissions.CREATE_PICKLIST || !this.oneSelectedRows(rows));
this.mergeNotAppropriate = (rows: IdlObject[]) => (!this.permissions.UPDATE_PICKLIST || this.noSelectedRows(rows));
this.deleteNotAppropriate = (rows: IdlObject[]) => (!this.permissions.UPDATE_PICKLIST || this.noSelectedRows(rows));
+
+ this.cellTextGenerator = {
+ name: row => row.name(),
+ };
}
openCreateDialog() {
[stickyHeader]="true"
[filterable]="true"
[sortable]="true"
+ [cellTextGenerator]="cellTextGenerator"
idlClass="acqpo" [dataSource]="gridSource">
<eg-grid-column path="name" [cellTemplate]="nameTmpl"></eg-grid-column>
import {NetService} from '@eg/core/net.service';
import {AuthService} from '@eg/core/auth.service';
import {GridComponent} from '@eg/share/grid/grid.component';
-import {GridDataSource} from '@eg/share/grid/grid';
+import {GridDataSource, GridCellTextGenerator} from '@eg/share/grid/grid';
import {AcqSearchService, AcqSearchTerm, AcqSearch} from './acq-search.service';
import {AcqSearchFormComponent} from './acq-search-form.component';
gridSource: GridDataSource;
@ViewChild('acqSearchPurchaseOrdersGrid', { static: true }) purchaseOrderResultsGrid: GridComponent;
+ cellTextGenerator: GridCellTextGenerator;
+
constructor(
private router: Router,
private route: ActivatedRoute,
ngOnInit() {
this.gridSource = this.acqSearch.getAcqSearchDataSource('purchase_order');
+
+ this.cellTextGenerator = {
+ provider: row => row.provider().code(),
+ name: row => row.name(),
+ };
}
doSearch(search: AcqSearch) {