Skip to content

Commit bea1d95

Browse files
authored
Merge branch 'master' into mpopov/fix/button/fix-for-14759
2 parents a4eb3ca + 1b9d9e2 commit bea1d95

40 files changed

+851
-220
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ All notable changes for each version of this project will be documented in this
1010
```ts
1111
this.carousel.select(2, Direction.NEXT);
1212
```
13+
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
14+
- Added ability to pin individual columns to a specific side (start or end of the grid), so that you can now have pinning from both sides. This can be done either declaratively by setting the `pinningPosition` property on the column:
15+
16+
```html
17+
<igx-column [field]="'Col1'" [pinned]='true' [pinningPosition]='pinningPosition'>
18+
</igx-column>
19+
```
20+
21+
```ts
22+
public pinningPosition = ColumnPinningPosition.End;
23+
```
24+
25+
Or with the API, via optional parameter:
26+
27+
```ts
28+
grid.pinColumn('Col1', 0, ColumnPinningPosition.End);
29+
grid.pinColumn('Col2', 0, ColumnPinningPosition.Start);
30+
```
31+
32+
If property `pinningPosition` is not set on a column, the column will default to the position specified on the grid's `pinning` options for `columns`.
1333

1434
- `IgxDateRangePicker`
1535
- Added new properties:

projects/igniteui-angular-elements/src/analyzer/elements.config.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ export var registerConfig = [
274274
{ name: "defaultHeaderGroupMinWidth" },
275275
{ name: "columns" },
276276
{ name: "pinnedColumns" },
277+
{ name: "pinnedStartColumns" },
278+
{ name: "pinnedEndColumns" },
277279
{ name: "pinnedRows" },
278280
{ name: "unpinnedColumns" },
279281
{ name: "visibleColumns" },
@@ -327,7 +329,8 @@ export var registerConfig = [
327329
"findPrev",
328330
"refreshSearch",
329331
"clearSearch",
330-
"getPinnedWidth",
332+
"getPinnedStartWidth",
333+
"getPinnedEndWidth",
331334
"selectRows",
332335
"deselectRows",
333336
"selectAllRows",
@@ -568,6 +571,8 @@ export var registerConfig = [
568571
{ name: "defaultHeaderGroupMinWidth" },
569572
{ name: "columns" },
570573
{ name: "pinnedColumns" },
574+
{ name: "pinnedStartColumns" },
575+
{ name: "pinnedEndColumns" },
571576
{ name: "pinnedRows" },
572577
{ name: "unpinnedColumns" },
573578
{ name: "visibleColumns" },
@@ -613,7 +618,8 @@ export var registerConfig = [
613618
"findPrev",
614619
"refreshSearch",
615620
"clearSearch",
616-
"getPinnedWidth",
621+
"getPinnedStartWidth",
622+
"getPinnedEndWidth",
617623
"selectRows",
618624
"deselectRows",
619625
"selectAllRows",
@@ -748,6 +754,8 @@ export var registerConfig = [
748754
{ name: "defaultRowHeight" },
749755
{ name: "defaultHeaderGroupMinWidth" },
750756
{ name: "columns" },
757+
{ name: "pinnedStartColumns" },
758+
{ name: "pinnedEndColumns" },
751759
{ name: "visibleColumns" },
752760
{ name: "dataView" },
753761
],
@@ -780,6 +788,7 @@ export var registerConfig = [
780788
"clearFilter",
781789
"clearSort",
782790
"reflow",
791+
"getPinnedEndWidth",
783792
"selectRows",
784793
"deselectRows",
785794
"selectAllRows",
@@ -872,6 +881,8 @@ export var registerConfig = [
872881
{ name: "defaultRowHeight" },
873882
{ name: "defaultHeaderGroupMinWidth" },
874883
{ name: "columns" },
884+
{ name: "pinnedStartColumns" },
885+
{ name: "pinnedEndColumns" },
875886
{ name: "pinnedRows" },
876887
],
877888
methods: [
@@ -908,7 +919,8 @@ export var registerConfig = [
908919
"findPrev",
909920
"refreshSearch",
910921
"clearSearch",
911-
"getPinnedWidth",
922+
"getPinnedStartWidth",
923+
"getPinnedEndWidth",
912924
"selectRows",
913925
"deselectRows",
914926
"selectAllRows",
@@ -1022,6 +1034,8 @@ export var registerConfig = [
10221034
{ name: "defaultHeaderGroupMinWidth" },
10231035
{ name: "columns" },
10241036
{ name: "pinnedColumns" },
1037+
{ name: "pinnedStartColumns" },
1038+
{ name: "pinnedEndColumns" },
10251039
{ name: "pinnedRows" },
10261040
{ name: "unpinnedColumns" },
10271041
{ name: "visibleColumns" },
@@ -1069,7 +1083,8 @@ export var registerConfig = [
10691083
"findPrev",
10701084
"refreshSearch",
10711085
"clearSearch",
1072-
"getPinnedWidth",
1086+
"getPinnedStartWidth",
1087+
"getPinnedEndWidth",
10731088
"selectRows",
10741089
"deselectRows",
10751090
"selectAllRows",

projects/igniteui-angular/src/lib/grids/columns/column-layout.component.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,10 @@ export class IgxColumnLayoutComponent extends IgxColumnGroupComponent implements
8282
}
8383

8484
const unpinnedColumns = this.grid.unpinnedColumns.filter(c => c.columnLayout && !c.hidden);
85-
const pinnedColumns = this.grid.pinnedColumns.filter(c => c.columnLayout && !c.hidden);
86-
let vIndex = -1;
87-
88-
if (!this.pinned) {
89-
const indexInCollection = unpinnedColumns.indexOf(this);
90-
vIndex = indexInCollection === -1 ? -1 : pinnedColumns.length + indexInCollection;
91-
} else {
92-
vIndex = pinnedColumns.indexOf(this);
93-
}
85+
const pinnedStart = this.grid.pinnedStartColumns.filter(c => c.columnLayout && !c.hidden);
86+
const pinnedEndColumns = this.grid.pinnedEndColumns.filter(c => c.columnLayout && !c.hidden);
87+
const ordered = pinnedStart.concat(unpinnedColumns, pinnedEndColumns);
88+
let vIndex = ordered.indexOf(this);
9489
this._vIndex = vIndex;
9590
return vIndex;
9691
}
@@ -158,7 +153,7 @@ export class IgxColumnLayoutComponent extends IgxColumnGroupComponent implements
158153
public override populateVisibleIndexes() {
159154
this.childrenVisibleIndexes = [];
160155
const columns = this.grid?.pinnedColumns && this.grid?.unpinnedColumns
161-
? this.grid.pinnedColumns.concat(this.grid.unpinnedColumns)
156+
? this.grid.pinnedStartColumns.concat(this.grid.unpinnedColumns, this.grid.pinnedEndColumns)
162157
: [];
163158
const orderedCols = columns
164159
.filter(x => !x.columnGroup && !x.hidden)

0 commit comments

Comments
 (0)