+
+
+
diff --git a/demo-shell/src/app/components/datatable/datatable.component.scss b/demo-shell/src/app/components/datatable/datatable.component.scss
new file mode 100644
index 0000000000..cc47d9f49b
--- /dev/null
+++ b/demo-shell/src/app/components/datatable/datatable.component.scss
@@ -0,0 +1,13 @@
+.adf-datatable-demo-app {
+ height: 310px;
+ overflow-y: auto;
+
+ &-actions {
+ display: flex;
+ column-gap: 4px;
+ }
+
+ &-custom-user-header {
+ color: red;
+ }
+}
diff --git a/demo-shell/src/app/components/datatable/datatable.component.ts b/demo-shell/src/app/components/datatable/datatable.component.ts
index b57448cb98..58b193c38c 100644
--- a/demo-shell/src/app/components/datatable/datatable.component.ts
+++ b/demo-shell/src/app/components/datatable/datatable.component.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import { Component, Input } from '@angular/core';
+import { Component, Input, ViewChild } from '@angular/core';
import {
DataCellEvent,
DataColumn,
@@ -56,17 +56,20 @@ export class FilteredDataAdapter extends ObjectDataTableAdapter {
@Component({
selector: 'app-datatable',
- templateUrl: './datatable.component.html'
+ templateUrl: './datatable.component.html',
+ styleUrls: ['./datatable.component.scss']
})
export class DataTableComponent {
+ @Input()
+ selectionMode = 'single';
+
+ @ViewChild('customColumnHeaderTemplate') customColumnHeaderTemplate;
+
multiselect = false;
data: FilteredDataAdapter;
stickyHeader = false;
- @Input()
- selectionMode = 'single';
-
selectionModes = [
{ value: 'none', viewValue: 'None' },
{ value: 'single', viewValue: 'Single' },
@@ -298,6 +301,21 @@ export class DataTableComponent {
this.data.setColumns(columns);
}
+ showCustomHeaderColumn() {
+ const columns = this.data.getColumns().map(column => {
+ if (column.title === 'Users') {
+ return {
+ ...column,
+ header: this.customColumnHeaderTemplate
+ };
+ }
+
+ return column;
+ });
+
+ this.data.setColumns(columns);
+ }
+
onShowRowActionsMenu(event: DataCellEvent) {
const myAction = {
title: 'Hello'
diff --git a/lib/core/datatable/components/datatable/datatable.component.html b/lib/core/datatable/components/datatable/datatable.component.html
index ddde207300..88a3423321 100644
--- a/lib/core/datatable/components/datatable/datatable.component.html
+++ b/lib/core/datatable/components/datatable/datatable.component.html
@@ -48,7 +48,6 @@
adf-drop-zone dropTarget="header" [dropColumn]="col">
-
-