Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit 5f6c31a

Browse files
authored
Merge pull request #1059 from ghiscoding/chore/autoheight-with-grid-menu
chore: add Grid Menu styling to grid with `autoHeight`
2 parents 46d8210 + 70d7475 commit 5f6c31a

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// sort indication will show behind Grid Menu since we don't have scroll,
2+
// we can offset these icons to fix that
3+
#grid23 {
4+
.slick-header-column:last-child {
5+
.slick-header-menu-button,
6+
.slick-resizable-handle,
7+
.slick-sort-indicator,
8+
.slick-sort-indicator-numbered {
9+
margin-right: 18px; // grid menu icon width
10+
}
11+
}
12+
}
13+
14+
.duration-bg {
15+
background-color: #e9d4f1 !important;
16+
}

src/app/examples/grid-autoheight.component.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {
1111
} from './../modules/angular-slickgrid';
1212

1313
@Component({
14-
styles: ['.duration-bg { background-color: #e9d4f1 !important }'],
1514
encapsulation: ViewEncapsulation.None,
15+
styleUrls: ['./grid-autoheight.component.scss'],
1616
templateUrl: './grid-autoheight.component.html'
1717
})
1818
export class GridAutoHeightComponent implements OnInit {
@@ -51,23 +51,20 @@ export class GridAutoHeightComponent implements OnInit {
5151
this.columnDefinitions = [
5252
{
5353
id: 'title', name: 'Title', field: 'title',
54-
sortable: true,
55-
type: FieldType.string
54+
sortable: true, type: FieldType.string
5655
},
5756
{
5857
id: 'duration', name: 'Duration (days)', field: 'duration',
59-
sortable: true,
60-
type: FieldType.number
58+
sortable: true, type: FieldType.number
6159
},
6260
{
6361
id: 'complete', name: '% Complete', field: 'percentComplete',
64-
formatter: Formatters.percentCompleteBar,
62+
formatter: Formatters.percentCompleteBar, sortable: true,
6563
type: FieldType.number
6664
},
6765
{
6866
id: 'start', name: 'Start', field: 'start',
69-
formatter: Formatters.dateIso,
70-
sortable: true,
67+
formatter: Formatters.dateIso, sortable: true,
7168
type: FieldType.date
7269
},
7370
{
@@ -77,7 +74,7 @@ export class GridAutoHeightComponent implements OnInit {
7774
},
7875
{
7976
id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
80-
formatter: Formatters.checkmark,
77+
formatter: Formatters.checkmark, sortable: true,
8178
type: FieldType.number
8279
}
8380
];
@@ -99,7 +96,6 @@ export class GridAutoHeightComponent implements OnInit {
9996
enableFiltering: true,
10097
showHeaderRow: false, // hide the filter row (header row)
10198

102-
enableGridMenu: false, // disable grid menu & remove vertical scroll
10399
alwaysShowVerticalScroll: false,
104100
enableColumnPicker: true,
105101
enableCellNavigation: true,

0 commit comments

Comments
 (0)