Skip to content

Commit 2d77893

Browse files
committed
fix(partial-finjs): removing chart column for partial as it cannot work
1 parent 29acdf7 commit 2d77893

3 files changed

Lines changed: 24 additions & 19 deletions

File tree

projects/app-lob/src/app/grid-finjs/grid-finjs.component.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,15 @@
7474
</div>
7575
</ng-template>
7676
</igx-column>
77-
<igx-column [field]="'Chart'" [width]="'60px'" [hidden]="false" [filterable]="false">
78-
<ng-template igxCell let-cell="cell" class="center-text">
79-
<button class="button-icon" igxIconButton="flat" tabindex="-1">
80-
<igx-icon family="material" (click)="chartColumnAction(cell)">insert_chart_outlined</igx-icon>
81-
</button>
82-
</ng-template>
83-
</igx-column>
77+
@if (allowChart) {
78+
<igx-column [field]="'Chart'" [width]="'60px'" [filterable]="false">
79+
<ng-template igxCell let-cell="cell" class="center-text">
80+
<button class="button-icon" igxIconButton="flat" tabindex="-1">
81+
<igx-icon family="material" (click)="chartColumnAction(cell)">insert_chart_outlined</igx-icon>
82+
</button>
83+
</ng-template>
84+
</igx-column>
85+
}
8486

8587
<igx-column [field]="'change'" [width]="'120px'" dataType="number" [headerClasses]="'headerAlignSyle'"
8688
[sortable]="true" [cellClasses]="trendsChange" >

projects/app-lob/src/app/grid-finjs/grid-finjs.component.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
/* eslint-disable max-len */
22
import { AsyncPipe, CurrencyPipe } from '@angular/common';
3-
import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild, DOCUMENT, inject } from '@angular/core';
3+
import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild, DOCUMENT, inject } from '@angular/core';
44
import { CellType, DefaultSortingStrategy, GridSelectionMode, IGridKeydownEventArgs, IgxGridComponent, IgxOverlayOutletDirective, IRowSelectionEventArgs, OverlaySettings, SortingDirection, IgxGridToolbarComponent, IgxGridToolbarActionsComponent, IgxGridToolbarHidingComponent, IgxGridToolbarPinningComponent, IgxGridToolbarExporterComponent, IgxExcelTextDirective, IgxColumnComponent, IgxCellEditorTemplateDirective, IgxSelectComponent, IgxFocusDirective, IgxSelectItemComponent, IgxCellTemplateDirective, IgxIconComponent, IgxIconButtonDirective } from 'igniteui-angular';
55
import { BehaviorSubject } from 'rxjs';
66
import { Contract, REGIONS, Stock } from '../data/financialData';
7-
import { SignalRService } from '../services/signal-r.service';
8-
import { IgxPreventDocumentScrollDirective } from '../../../../../src/app/directives/prevent-scroll.directive';
7+
import { SignalRService } from '../services/signal-r.service';
8+
import { IgxPreventDocumentScrollDirective } from '../../../../../src/app/directives/prevent-scroll.directive';
99
import { FormsModule } from '@angular/forms';
1010

11-
@Component({
12-
selector: 'app-finjs-grid',
13-
templateUrl: './grid-finjs.component.html',
14-
styleUrls: ['./grid-finjs.component.scss'],
15-
imports: [IgxGridComponent, IgxPreventDocumentScrollDirective, IgxGridToolbarComponent, IgxGridToolbarActionsComponent, IgxGridToolbarHidingComponent, IgxGridToolbarPinningComponent, IgxGridToolbarExporterComponent, IgxExcelTextDirective, IgxColumnComponent, IgxCellEditorTemplateDirective, IgxSelectComponent, FormsModule, IgxFocusDirective, IgxSelectItemComponent, IgxCellTemplateDirective, IgxIconComponent, IgxIconButtonDirective, IgxOverlayOutletDirective, AsyncPipe, CurrencyPipe]
11+
@Component({
12+
selector: 'app-finjs-grid',
13+
templateUrl: './grid-finjs.component.html',
14+
styleUrls: ['./grid-finjs.component.scss'],
15+
imports: [IgxGridComponent, IgxPreventDocumentScrollDirective, IgxGridToolbarComponent, IgxGridToolbarActionsComponent, IgxGridToolbarHidingComponent, IgxGridToolbarPinningComponent, IgxGridToolbarExporterComponent, IgxExcelTextDirective, IgxColumnComponent, IgxCellEditorTemplateDirective, IgxSelectComponent, FormsModule, IgxFocusDirective, IgxSelectItemComponent, IgxCellTemplateDirective, IgxIconComponent, IgxIconButtonDirective, IgxOverlayOutletDirective, AsyncPipe, CurrencyPipe]
1616
})
17-
export class GridFinJSComponent implements OnInit {
18-
private el = inject(ElementRef);
19-
private document = inject<Document>(DOCUMENT);
20-
dataService = inject(SignalRService);
17+
export class GridFinJSComponent implements OnInit {
18+
private el = inject(ElementRef);
19+
private document = inject<Document>(DOCUMENT);
20+
dataService = inject(SignalRService);
2121

2222
@ViewChild('grid1', { static: true }) public grid: IgxGridComponent;
2323
@ViewChild(IgxOverlayOutletDirective, { static: true }) public outlet: IgxOverlayOutletDirective;
2424
@Output() public selectedDataChanged = new EventEmitter<Stock[]>();
2525
@Output() public keyDown = new EventEmitter();
2626
@Output() public chartColumnKeyDown = new EventEmitter<Stock>();
2727

28+
@Input() public allowChart = false;
29+
2830
public contracts = Contract;
2931
public regions = REGIONS;
3032
public selectionMode: GridSelectionMode = 'multiple';

projects/app-lob/src/app/grid-finjs/main.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
(playAction)="onPlayAction($event)">
77
</app-finjs-controllers>
88
<app-finjs-grid #finGrid
9+
[allowChart]="true"
910
(selectedDataChanged)="setChartData($event)"
1011
(keyDown)="dialog.open()"
1112
(chartColumnKeyDown)="openSingleRowChart($event)">

0 commit comments

Comments
 (0)