Skip to content

Commit 431fce7

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Add some documentation for new apis.
1 parent 6effe05 commit 431fce7

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.component.ts

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,18 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
10401040
}
10411041
}
10421042

1043+
/**
1044+
* Inserts dimension in target collection by type at specified index or at the collection's end.
1045+
*
1046+
* @example
1047+
* ```typescript
1048+
* this.grid.insertDimensionAt(dimension, PivotDimensionType.Row, 1);
1049+
* ```
1050+
* @param dimension The dimension that will be added.
1051+
* @param targetCollectionType The target collection type to add to. Can be Row, Column or Filter.
1052+
* @param index The index in the collection at which to add.
1053+
* This parameter is optional. If not set it will add it to the end of the collection.
1054+
*/
10431055
public insertDimensionAt(dimension: IPivotDimension, targetCollectionType: PivotDimensionType, index?: number) {
10441056
const targetCollection = this.getDimensionsByType(targetCollectionType);
10451057
if (index !== undefined) {
@@ -1054,13 +1066,36 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
10541066
this.dimensionsChange.emit({ dimensions: targetCollection, dimensionCollectionType: targetCollectionType });
10551067
}
10561068

1069+
/**
1070+
* Move dimension from its currently collection to the specified target collection by type at specified index or at the collection's end.
1071+
*
1072+
* @example
1073+
* ```typescript
1074+
* this.grid.moveDimension(dimension, PivotDimensionType.Row, 1);
1075+
* ```
1076+
* @param dimension The dimension that will be moved.
1077+
* @param targetCollectionType The target collection type to move it to. Can be Row, Column or Filter.
1078+
* @param index The index in the collection at which to add.
1079+
* This parameter is optional. If not set it will add it to the end of the collection.
1080+
*/
10571081
public moveDimension(dimension: IPivotDimension, targetCollectionType: PivotDimensionType, index?: number) {
10581082
// remove from old collection
10591083
this.removeDimension(dimension);
10601084
// add to target
10611085
this.insertDimensionAt(dimension, targetCollectionType, index);
10621086
}
10631087

1088+
/**
1089+
* Removes dimension from its currently collection.
1090+
* @remarks
1091+
* This is different than toggleDimension that enabled/disables the dimension.
1092+
* This completely removes the specified dimension from the collection.
1093+
* @example
1094+
* ```typescript
1095+
* this.grid.removeDimension(dimension);
1096+
* ```
1097+
* @param dimension The dimension to be removed.
1098+
*/
10641099
public removeDimension(dimension: IPivotDimension) {
10651100
const prevCollectionType = this.getDimensionType(dimension);
10661101
const prevCollection = this.getDimensionsByType(prevCollectionType);
@@ -1072,14 +1107,24 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
10721107
this.pipeTrigger++;
10731108
}
10741109

1110+
/**
1111+
* Toggles the dimension's enabled state on or off.
1112+
* @remarks
1113+
* The dimension remains in its current collection. This just changes its enabled state.
1114+
* @example
1115+
* ```typescript
1116+
* this.grid.toggleDimension(dimension);
1117+
* ```
1118+
* @param dimension The dimension to be toggled.
1119+
*/
10751120
public toggleDimension(dimension: IPivotDimension) {
10761121
const dimType = this.getDimensionType(dimension);
10771122
const collection = this.getDimensionsByType(dimType);
10781123
dimension.enabled = !dimension.enabled;
10791124
if (dimType === PivotDimensionType.Column) {
10801125
this.setupColumns();
10811126
}
1082-
if(!dimension.enabled) {
1127+
if (!dimension.enabled) {
10831128
this.filteringService.clearFilter(dimension.memberName);
10841129
}
10851130
this.pipeTrigger++;

0 commit comments

Comments
 (0)