+
|
-
+ |
|
-
+ |
|
-
+ |
|
-
-
+
+ |
|
-
-
+
+ |
-
- {{ grid.getSetting('noDataMessage') }}
+ |
+ {{ noDataMessage }}
|
diff --git a/src/ng2-smart-table/components/tbody/tbody.component.ts b/src/ng2-smart-table/components/tbody/tbody.component.ts
index d17a28741..cb7004953 100644
--- a/src/ng2-smart-table/components/tbody/tbody.component.ts
+++ b/src/ng2-smart-table/components/tbody/tbody.component.ts
@@ -1,7 +1,9 @@
-import { Component, Input, Output, EventEmitter } from '@angular/core';
+import {Component, Input, Output, EventEmitter, } from '@angular/core';
import { Grid } from '../../lib/grid';
+import { Row } from '../../lib/data-set/row';
import { DataSource } from '../../lib/data-source/data-source';
+import {Column} from "../../lib/data-set/column";
@Component({
selector: '[ng2-st-tbody]',
@@ -25,4 +27,26 @@ export class Ng2SmartTableTbodyComponent {
@Output() editRowSelect = new EventEmitter();
@Output() multipleSelectRow = new EventEmitter();
@Output() rowHover = new EventEmitter();
+
+ isMultiSelectVisible: boolean;
+ showActionColumnLeft: boolean;
+ showActionColumnRight: boolean;
+ mode: string;
+ editInputClass: string;
+ isActionAdd: boolean;
+ isActionEdit: boolean;
+ isActionDelete: boolean;
+ noDataMessage: boolean;
+
+ ngOnChanges() {
+ this.isMultiSelectVisible = this.grid.isMultiSelectVisible()
+ this.showActionColumnLeft = this.grid.showActionColumn('left');
+ this.mode = this.grid.getSetting('mode');
+ this.editInputClass = this.grid.getSetting('edit.inputClass');
+ this.showActionColumnRight = this.grid.showActionColumn('right');
+ this.isActionAdd = this.grid.getSetting('actions.add');
+ this.isActionEdit = this.grid.getSetting('actions.edit');
+ this.isActionDelete = this.grid.getSetting('actions.delete');
+ this.noDataMessage = this.grid.getSetting('noDataMessage');
+ }
}
diff --git a/src/ng2-smart-table/components/thead/cells/actions-title.component.ts b/src/ng2-smart-table/components/thead/cells/actions-title.component.ts
index f33c685c6..ab5e34af9 100644
--- a/src/ng2-smart-table/components/thead/cells/actions-title.component.ts
+++ b/src/ng2-smart-table/components/thead/cells/actions-title.component.ts
@@ -1,21 +1,27 @@
-import { Component, Input, AfterViewInit, ElementRef } from '@angular/core';
+import {Component, Input, AfterViewInit, ElementRef, OnChanges} from '@angular/core';
import { Grid } from '../../../lib/grid';
@Component({
selector: '[ng2-st-actions-title]',
template: `
- {{ grid.getSetting('actions.columnTitle') }}
+ {{ actionsColumnTitle }}
`,
})
-export class ActionsTitleComponent implements AfterViewInit {
+export class ActionsTitleComponent implements AfterViewInit, OnChanges {
@Input() grid: Grid;
+ actionsColumnTitle: string;
+
constructor(private ref: ElementRef) {
}
ngAfterViewInit() {
this.ref.nativeElement.classList.add('ng2-smart-actions');
}
+
+ ngOnChanges() {
+ this.actionsColumnTitle = this.grid.getSetting('actions.columnTitle');
+ }
}
diff --git a/src/ng2-smart-table/components/thead/cells/actions.component.ts b/src/ng2-smart-table/components/thead/cells/actions.component.ts
index 234764e37..1d7c33402 100644
--- a/src/ng2-smart-table/components/thead/cells/actions.component.ts
+++ b/src/ng2-smart-table/components/thead/cells/actions.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input, Output, EventEmitter } from '@angular/core';
+import {Component, Input, Output, EventEmitter, OnChanges } from '@angular/core';
import { Grid } from '../../../lib/grid';
@@ -6,15 +6,23 @@ import { Grid } from '../../../lib/grid';
selector: 'ng2-st-actions',
template: `
`,
})
-export class ActionsComponent {
+export class ActionsComponent implements OnChanges {
@Input() grid: Grid;
@Output() create = new EventEmitter();
+
+ createButtonContent: string;
+ cancelButtonContent: string;
+
+ ngOnChanges() {
+ this.createButtonContent = this.grid.getSetting('add.createButtonContent');
+ this.cancelButtonContent = this.grid.getSetting('add.cancelButtonContent');
+ }
}
diff --git a/src/ng2-smart-table/components/thead/cells/add-button.component.ts b/src/ng2-smart-table/components/thead/cells/add-button.component.ts
index ff5b3e6a6..f66025030 100644
--- a/src/ng2-smart-table/components/thead/cells/add-button.component.ts
+++ b/src/ng2-smart-table/components/thead/cells/add-button.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input, Output, EventEmitter, AfterViewInit, ElementRef } from '@angular/core';
+import { Component, Input, Output, EventEmitter, AfterViewInit, ElementRef, OnChanges } from '@angular/core';
import { Grid } from '../../../lib/grid';
import { DataSource } from '../../../lib/data-source/data-source';
@@ -6,16 +6,19 @@ import { DataSource } from '../../../lib/data-source/data-source';
@Component({
selector: '[ng2-st-add-button]',
template: `
-
+
`,
})
-export class AddButtonComponent implements AfterViewInit {
+export class AddButtonComponent implements AfterViewInit, OnChanges {
@Input() grid: Grid;
@Input() source: DataSource;
@Output() create = new EventEmitter();
+ isActionAdd: boolean;
+ addNewButtonContent: string;
+
constructor(private ref: ElementRef) {
}
@@ -23,6 +26,11 @@ export class AddButtonComponent implements AfterViewInit {
this.ref.nativeElement.classList.add('ng2-smart-actions-title', 'ng2-smart-actions-title-add');
}
+ ngOnChanges() {
+ this.isActionAdd = this.grid.getSetting('actions.add');
+ this.addNewButtonContent = this.grid.getSetting('add.addButtonContent');
+ }
+
onAdd(event: any) {
event.preventDefault();
event.stopPropagation();
diff --git a/src/ng2-smart-table/components/thead/rows/thead-filters-row.component.ts b/src/ng2-smart-table/components/thead/rows/thead-filters-row.component.ts
index 681e73e6f..143cabe7d 100644
--- a/src/ng2-smart-table/components/thead/rows/thead-filters-row.component.ts
+++ b/src/ng2-smart-table/components/thead/rows/thead-filters-row.component.ts
@@ -1,31 +1,32 @@
-import { Component, Input, Output, EventEmitter } from '@angular/core';
+import {Component, Input, Output, EventEmitter, OnChanges} from '@angular/core';
import { Grid } from '../../../lib/grid';
import { DataSource } from '../../../lib/data-source/data-source';
+import { Column } from "../../../lib/data-set/column";
@Component({
selector: '[ng2-st-thead-filters-row]',
template: `
- |
- |
+
|
|
-
|
`,
})
-export class TheadFitlersRowComponent {
+export class TheadFitlersRowComponent implements OnChanges {
@Input() grid: Grid;
@Input() source: DataSource;
@@ -33,4 +34,15 @@ export class TheadFitlersRowComponent {
@Output() create = new EventEmitter();
@Output() filter = new EventEmitter();
+ isMultiSelectVisible: boolean;
+ showActionColumnLeft: boolean;
+ showActionColumnRight: boolean;
+ filterInputClass: string;
+
+ ngOnChanges() {
+ this.isMultiSelectVisible = this.grid.isMultiSelectVisible();
+ this.showActionColumnLeft = this.grid.showActionColumn('left');
+ this.showActionColumnRight = this.grid.showActionColumn('right');
+ this.filterInputClass = this.grid.getSetting('filter.inputClass');
+ }
}
diff --git a/src/ng2-smart-table/components/thead/rows/thead-form-row.component.ts b/src/ng2-smart-table/components/thead/rows/thead-form-row.component.ts
index 6e93fe01c..87513ac4a 100644
--- a/src/ng2-smart-table/components/thead/rows/thead-form-row.component.ts
+++ b/src/ng2-smart-table/components/thead/rows/thead-form-row.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input, Output, EventEmitter } from '@angular/core';
+import { Component, Input, Output, EventEmitter, OnChanges } from '@angular/core';
import { Grid } from '../../../lib/grid';
import { Row } from '../../../lib/data-set/row';
@@ -6,8 +6,8 @@ import { Row } from '../../../lib/data-set/row';
@Component({
selector: '[ng2-st-thead-form-row]',
template: `
- |
-
+ | |
+
|
@@ -15,17 +15,17 @@ import { Row } from '../../../lib/data-set/row';
[grid]="grid"
[isNew]="true"
[createConfirm]="createConfirm"
- [inputClass]="grid.getSetting('add.inputClass')"
+ [inputClass]="addInputClass"
[isInEditing]="grid.getNewRow().isInEditing"
(edited)="onCreate($event)">
|
-
+ |
|
`,
})
-export class TheadFormRowComponent {
+export class TheadFormRowComponent implements OnChanges {
@Input() grid: Grid;
@Input() row: Row;
@@ -33,10 +33,21 @@ export class TheadFormRowComponent {
@Output() create = new EventEmitter();
+ isMultiSelectVisible: boolean;
+ showActionColumnLeft: boolean;
+ showActionColumnRight: boolean;
+ addInputClass: string;
+
onCreate(event: any) {
event.stopPropagation();
this.grid.create(this.grid.getNewRow(), this.createConfirm);
}
+ ngOnChanges(){
+ this.isMultiSelectVisible = this.grid.isMultiSelectVisible();
+ this.showActionColumnLeft = this.grid.showActionColumn('left');
+ this.showActionColumnRight = this.grid.showActionColumn('right');
+ this.addInputClass = this.grid.getSetting('add.inputClass');
+ }
}
diff --git a/src/ng2-smart-table/components/thead/rows/thead-titles-row.component.ts b/src/ng2-smart-table/components/thead/rows/thead-titles-row.component.ts
index 15cae92cc..50f2166d3 100644
--- a/src/ng2-smart-table/components/thead/rows/thead-titles-row.component.ts
+++ b/src/ng2-smart-table/components/thead/rows/thead-titles-row.component.ts
@@ -1,26 +1,27 @@
-import { Component, Input, Output, EventEmitter } from '@angular/core';
+import {Component, Input, Output, EventEmitter, OnChanges} from '@angular/core';
import { Grid } from '../../../lib/grid';
import { DataSource } from '../../../lib/data-source/data-source';
+import { Column } from "../../../lib/data-set/column";
@Component({
selector: '[ng2-st-thead-titles-row]',
template: `
-
|
- |
+ |
|
- |
+ |
`,
})
-export class TheadTitlesRowComponent {
+export class TheadTitlesRowComponent implements OnChanges {
@Input() grid: Grid;
@Input() isAllSelected: boolean;
@@ -29,4 +30,15 @@ export class TheadTitlesRowComponent {
@Output() sort = new EventEmitter();
@Output() selectAllRows = new EventEmitter();
+ isMultiSelectVisible: boolean;
+ showActionColumnLeft: boolean;
+ showActionColumnRight: boolean;
+
+
+ ngOnChanges() {
+ this.isMultiSelectVisible = this.grid.isMultiSelectVisible();
+ this.showActionColumnLeft = this.grid.showActionColumn('left');
+ this.showActionColumnRight = this.grid.showActionColumn('right');
+ }
+
}
diff --git a/src/ng2-smart-table/components/thead/thead.component.html b/src/ng2-smart-table/components/thead/thead.component.html
index 4dcabdf8b..d6a98f06f 100644
--- a/src/ng2-smart-table/components/thead/thead.component.html
+++ b/src/ng2-smart-table/components/thead/thead.component.html
@@ -1,4 +1,4 @@
-
-
-
\ No newline at end of file
+ |
diff --git a/src/ng2-smart-table/components/thead/thead.component.ts b/src/ng2-smart-table/components/thead/thead.component.ts
index 30aceed2f..9eeff7227 100644
--- a/src/ng2-smart-table/components/thead/thead.component.ts
+++ b/src/ng2-smart-table/components/thead/thead.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input, Output, EventEmitter } from '@angular/core';
+import {Component, Input, Output, EventEmitter, OnChanges} from '@angular/core';
import { Grid } from '../../lib/grid';
import { DataSource } from '../../lib/data-source/data-source';
@@ -7,7 +7,7 @@ import { DataSource } from '../../lib/data-source/data-source';
selector: '[ng2-st-thead]',
templateUrl: './thead.component.html',
})
-export class Ng2SmartTableTheadComponent {
+export class Ng2SmartTableTheadComponent implements OnChanges {
@Input() grid: Grid;
@Input() source: DataSource;
@@ -18,4 +18,12 @@ export class Ng2SmartTableTheadComponent {
@Output() selectAllRows = new EventEmitter