Skip to content

Commit

Permalink
fix(tree-grid): removing the transaction for the tree grid dev demo #…
Browse files Browse the repository at this point in the history
  • Loading branch information
DiyanDimitrov authored and gedinakova committed Nov 5, 2018
1 parent 418002f commit e6c90d7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 71 deletions.
4 changes: 1 addition & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ import { GridRowEditSampleComponent } from './grid-row-edit/grid-row-edit-sample
import { GridWithTransactionsComponent } from './grid-row-edit/grid-with-transactions.component';
import { TreeGridSampleComponent } from './tree-grid/tree-grid.sample';
import { TreeGridFlatDataSampleComponent } from './tree-grid-flat-data/tree-grid-flat-data.sample';
import { HierarchicalTransactionWrapperComponent } from './tree-grid/hierarchical-transaction-wrapper';

const components = [
AppComponent,
Expand Down Expand Up @@ -137,8 +136,7 @@ const components = [
ShadowsSampleComponent,
TypographySampleComponent,
RadioSampleComponent,
TooltipSampleComponent,
HierarchicalTransactionWrapperComponent
TooltipSampleComponent
];

@NgModule({
Expand Down
26 changes: 10 additions & 16 deletions src/app/tree-grid-flat-data/tree-grid-flat-data.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@
<div class="density-chooser" style="margin-bottom: 16px">
<igx-buttongroup [values]="displayDensities" (onSelect)="selectDensity($event)" style="display: block; width: 500px"></igx-buttongroup>
</div>
<app-grid-with-hierarchical-transactions>
<igx-tree-grid #grid1 [data]="data" primaryKey="employeeID" foreignKey="PID" [rowSelectable]="true"
[paging]="false" [displayDensity]="density" [width]="'900px'" [height]="'500px'" [showToolbar]="true"
[columnHiding]="true" [columnPinning]="true" [exportExcel]="true" [exportCsv]="true" exportText="Export"
exportExcelText="Export to Excel" exportCsvText="Export to CSV">
<igx-column *ngFor="let c of columns" [field]="c.field" [dataType]="c.dataType" [header]="c.label"
[pinned]="c.pinned" [movable]="c.movable" [groupable]="false" [resizable]="c.resizable" [width]="c.width"
[sortable]="true" [filterable]="true" [editable]="true" [hidden]="c.hidden" [hasSummary]="c.summary"
[minWidth]="c.minWidth" [maxWidth]="c.maxWidth">
</igx-column>
</igx-tree-grid>
</app-grid-with-hierarchical-transactions>
<igx-tree-grid #grid1 [data]="data" primaryKey="employeeID" foreignKey="PID" [rowSelectable]="true"
[paging]="false" [displayDensity]="density" [width]="'900px'" [height]="'500px'" [showToolbar]="true"
[columnHiding]="true" [columnPinning]="true" [exportExcel]="true" [exportCsv]="true" exportText="Export"
exportExcelText="Export to Excel" exportCsvText="Export to CSV">
<igx-column *ngFor="let c of columns" [field]="c.field" [dataType]="c.dataType" [header]="c.label"
[pinned]="c.pinned" [movable]="c.movable" [groupable]="false" [resizable]="c.resizable" [width]="c.width"
[sortable]="true" [filterable]="true" [editable]="true" [hidden]="c.hidden" [hasSummary]="c.summary"
[minWidth]="c.minWidth" [maxWidth]="c.maxWidth">
</igx-column>
</igx-tree-grid>

<div class="topMargin">
<div class="toggle-group">
Expand All @@ -38,10 +36,6 @@
<button igxButton="raised" (click)="addRow()">Add row</button>
<button igxButton="raised" (click)="addChildRow()">Add child row</button>
<button igxButton="raised" (click)="deleteRow()">Delete selected row</button>
<button igxButton="raised" (click)="commit()">Commit</button>
<button igxButton="raised" (click)="undo()">Undo</button>
<button igxButton="raised" (click)="redo()">Redo</button>
<button igxButton="raised" (click)="log()">Log transactions</button>
</div>
</div>
</div>
Expand Down
16 changes: 0 additions & 16 deletions src/app/tree-grid-flat-data/tree-grid-flat-data.sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,4 @@ export class TreeGridFlatDataSampleComponent implements OnInit {
public selectDensity(event) {
this.density = this.displayDensities[event.index].label;
}

public commit() {
this.grid1.transactions.commit(this.data);
}

public undo() {
this.grid1.transactions.undo();
}

public redo() {
this.grid1.transactions.redo();
}

public log() {
console.dir(this.grid1.transactions);
}
}
9 changes: 0 additions & 9 deletions src/app/tree-grid/hierarchical-transaction-wrapper.ts

This file was deleted.

25 changes: 10 additions & 15 deletions src/app/tree-grid/tree-grid.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@
<div class="density-chooser" style="margin-bottom: 16px">
<igx-buttongroup [values]="displayDensities" (onSelect)="selectDensity($event)" style="display: block; width: 500px"></igx-buttongroup>
</div>
<app-grid-with-hierarchical-transactions>
<igx-tree-grid #grid1 [data]="data" childDataKey="ChildCompanies" primaryKey="ID" expansionDepth="1"
rowSelectable="true" [paging]="false" [displayDensity]="density" [width]="'900px'" [height]="'500px'"
[showToolbar]="true" [columnHiding]="true" [columnPinning]="true" [exportExcel]="true" [exportCsv]="true"
exportText="Export" exportExcelText="Export to Excel" exportCsvText="Export to CSV">
<igx-column *ngFor="let c of columns" [field]="c.field" [header]="c.field" [pinned]="c.pinned"
[movable]="c.movable" [groupable]="false" [resizable]="c.resizable" [width]="c.width"
[sortable]="true" [filterable]="true" [editable]="true" [hidden]="c.hidden" [hasSummary]="c.summary"
[minWidth]="c.minWidth" [maxWidth]="c.maxWidth">
</igx-column>
</igx-tree-grid>
</app-grid-with-hierarchical-transactions>
<igx-tree-grid #grid1 [data]="data" childDataKey="ChildCompanies" primaryKey="ID" expansionDepth="1"
rowSelectable="true" [paging]="false" [displayDensity]="density" [width]="'900px'" [height]="'500px'"
[showToolbar]="true" [columnHiding]="true" [columnPinning]="true" [exportExcel]="true" [exportCsv]="true"
exportText="Export" exportExcelText="Export to Excel" exportCsvText="Export to CSV">
<igx-column *ngFor="let c of columns" [field]="c.field" [header]="c.field" [pinned]="c.pinned"
[movable]="c.movable" [groupable]="false" [resizable]="c.resizable" [width]="c.width"
[sortable]="true" [filterable]="true" [editable]="true" [hidden]="c.hidden" [hasSummary]="c.summary"
[minWidth]="c.minWidth" [maxWidth]="c.maxWidth">
</igx-column>
</igx-tree-grid>

<div class="topMargin">
<igx-switch [(ngModel)]="grid1.paging">Enable Paging</igx-switch>
Expand All @@ -30,9 +28,6 @@
<button igxButton="raised" (click)="addRow()">Add row</button>
<button igxButton="raised" (click)="addChildRow()">Add child row</button>
<button igxButton="raised" (click)="deleteRow()">Delete Selected Row</button>
<button igxButton="raised" (click)="commit()">Commit</button>
<button igxButton="raised" (click)="undo()">Undo</button>
<button igxButton="raised" (click)="redo()">Redo</button>
</div>
</div>
</div>
Expand Down
12 changes: 0 additions & 12 deletions src/app/tree-grid/tree-grid.sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,16 +449,4 @@ export class TreeGridSampleComponent implements OnInit {
public deleteRow() {
this.grid1.deleteRowById(this.grid1.selectedRows()[0]);
}

public commit() {
this.grid1.transactions.commit(this.data);
}

public undo() {
this.grid1.transactions.undo();
}

public redo() {
this.grid1.transactions.redo();
}
}

0 comments on commit e6c90d7

Please sign in to comment.