@syncfusion/ej2-treegrid 21.2.8 → 21.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,6 +83,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
83
83
  private addedRecords;
84
84
  private targetElement;
85
85
  private isGantt;
86
+ private isAddedFromGantt;
86
87
  private isIndentEnabled;
87
88
  private indentOutdentAction;
88
89
  /**
@@ -637,14 +638,14 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
637
638
  * This helps to load large dataset in TreeGrid.
638
639
  *
639
640
  * @default false
640
-
641
+ * @deprecated
641
642
  */
642
643
  enableInfiniteScrolling: boolean;
643
644
  /**
644
645
  * Configures the infinite scroll settings.
645
646
  *
646
647
  * @default { enableCache: false, maxBlocks: 5, initialBlocks: 5 }
647
-
648
+ * @deprecated
648
649
  */
649
650
  infiniteScrollSettings: InfiniteScrollSettingsModel;
650
651
  /**
@@ -771,7 +772,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
771
772
  * Invoke the done method from the argument to start render after edit operation.
772
773
  *
773
774
  * @event dataSourceChanged
774
-
775
+ * @deprecated
775
776
  */
776
777
  dataSourceChanged: EmitType<DataSourceChangedEventArgs>;
777
778
  /**
@@ -779,7 +780,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
779
780
  * In this event,the current view data and total record count should be assigned to the `dataSource` based on the action performed.
780
781
  *
781
782
  * @event dataStateChange
782
-
783
+ * @deprecated
783
784
  */
784
785
  dataStateChange: EmitType<DataStateChangeEventArgs>;
785
786
  /**
@@ -831,7 +832,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
831
832
  * Triggers before deselecting the selected row.
832
833
  *
833
834
  * @event rowSelected
834
-
835
+ * @deprecated
835
836
  */
836
837
  rowDeselecting: EmitType<RowDeselectEventArgs>;
837
838
  /**
@@ -856,7 +857,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
856
857
  * Triggers before column menu opens.
857
858
  *
858
859
  * @event columnMenuOpen
859
-
860
+ * @deprecated
860
861
  */
861
862
  columnMenuOpen: EmitType<ColumnMenuOpenEventArgs>;
862
863
  /**
@@ -875,77 +876,77 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
875
876
  * Triggers before the selected cell is deselecting.
876
877
  *
877
878
  * @event cellDeselecting
878
-
879
+ * @deprecated
879
880
  */
880
881
  cellDeselecting: EmitType<CellDeselectEventArgs>;
881
882
  /**
882
883
  * Triggers when a particular selected cell is deselected.
883
884
  *
884
885
  * @event cellDeselected
885
-
886
+ * @deprecated
886
887
  */
887
888
  cellDeselected: EmitType<CellDeselectEventArgs>;
888
889
  /**
889
890
  * Triggers when column resize starts.
890
891
  *
891
892
  * @event resizeStart
892
-
893
+ * @deprecated
893
894
  */
894
895
  resizeStart: EmitType<ResizeArgs>;
895
896
  /**
896
897
  * Triggers on column resizing.
897
898
  *
898
899
  * @event resizing
899
-
900
+ * @deprecated
900
901
  */
901
902
  resizing: EmitType<ResizeArgs>;
902
903
  /**
903
904
  * Triggers when column resize ends.
904
905
  *
905
906
  * @event resizeStop
906
-
907
+ * @deprecated
907
908
  */
908
909
  resizeStop: EmitType<ResizeArgs>;
909
910
  /**
910
911
  * Triggers when column header element drag (move) starts.
911
912
  *
912
913
  * @event columnDragStart
913
-
914
+ * @deprecated
914
915
  */
915
916
  columnDragStart: EmitType<ColumnDragEventArgs>;
916
917
  /**
917
918
  * Triggers when column header element is dragged (moved) continuously.
918
919
  *
919
920
  * @event columnDrag
920
-
921
+ * @deprecated
921
922
  */
922
923
  columnDrag: EmitType<ColumnDragEventArgs>;
923
924
  /**
924
925
  * Triggers when a column header element is dropped on the target column.
925
926
  *
926
927
  * @event columnDrop
927
-
928
+ * @deprecated
928
929
  */
929
930
  columnDrop: EmitType<ColumnDragEventArgs>;
930
931
  /**
931
932
  * Triggers when the check box state change in checkbox column.
932
933
  *
933
934
  * @event checkboxChange
934
-
935
+ * @deprecated
935
936
  */
936
937
  checkboxChange: EmitType<CheckBoxChangeEventArgs>;
937
938
  /**
938
939
  * Triggers after print action is completed.
939
940
  *
940
941
  * @event printComplete
941
-
942
+ * @deprecated
942
943
  */
943
944
  printComplete: EmitType<PrintEventArgs>;
944
945
  /**
945
946
  * Triggers before the print action starts.
946
947
  *
947
948
  * @event beforePrint
948
-
949
+ * @deprecated
949
950
  */
950
951
  beforePrint: EmitType<PrintEventArgs>;
951
952
  /**
@@ -964,7 +965,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
964
965
  * Triggers before context menu opens.
965
966
  *
966
967
  * @event contextMenuOpen
967
-
968
+ * @deprecated
968
969
  */
969
970
  contextMenuOpen: EmitType<BeforeOpenCloseMenuEventArgs>;
970
971
  /**
@@ -977,42 +978,42 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
977
978
  * Triggers before TreeGrid copy action.
978
979
  *
979
980
  * @event beforeCopy
980
-
981
+ * @deprecated
981
982
  */
982
983
  beforeCopy: EmitType<BeforeCopyEventArgs>;
983
984
  /**
984
985
  * Triggers before TreeGrid paste action.
985
986
  *
986
987
  * @event beforePaste
987
-
988
+ * @deprecated
988
989
  */
989
990
  beforePaste: EmitType<BeforePasteEventArgs>;
990
991
  /**
991
992
  * Triggers when row elements are dragged (moved) continuously.
992
993
  *
993
994
  * @event rowDrag
994
-
995
+ * @deprecated
995
996
  */
996
997
  rowDrag: EmitType<RowDragEventArgs>;
997
998
  /**
998
999
  * Triggers when row element’s drag(move) starts.
999
1000
  *
1000
1001
  * @event rowDragStart
1001
-
1002
+ * @deprecated
1002
1003
  */
1003
1004
  rowDragStart: EmitType<RowDragEventArgs>;
1004
1005
  /**
1005
1006
  * Triggers when row element’s before drag(move).
1006
1007
  *
1007
1008
  * @event rowDragStartHelper
1008
-
1009
+ * @deprecated
1009
1010
  */
1010
1011
  rowDragStartHelper: EmitType<RowDragEventArgs>;
1011
1012
  /**
1012
1013
  * Triggers when row elements are dropped on the target row.
1013
1014
  *
1014
1015
  * @event rowDrop
1015
-
1016
+ * @deprecated
1016
1017
  */
1017
1018
  rowDrop: EmitType<RowDragEventArgs>;
1018
1019
  /**
@@ -1049,7 +1050,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1049
1050
  * You can also customize the PDF cells.
1050
1051
  *
1051
1052
  * @event pdfQueryCellInfo
1052
-
1053
+ * @deprecated
1053
1054
  */
1054
1055
  pdfQueryCellInfo: EmitType<PdfQueryCellInfoEventArgs>;
1055
1056
  /**
@@ -1057,7 +1058,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1057
1058
  * You can also customize the PDF cells.
1058
1059
  *
1059
1060
  * @event pdfHeaderQueryCellInfo
1060
-
1061
+ * @deprecated
1061
1062
  */
1062
1063
  pdfHeaderQueryCellInfo: EmitType<PdfHeaderQueryCellInfoEventArgs>;
1063
1064
  /**
@@ -1065,7 +1066,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1065
1066
  * You can also customize the Excel cells.
1066
1067
  *
1067
1068
  * @event excelQueryCellInfo
1068
-
1069
+ * @deprecated
1069
1070
  */
1070
1071
  excelQueryCellInfo: EmitType<ExcelQueryCellInfoEventArgs>;
1071
1072
  /**
@@ -1073,7 +1074,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1073
1074
  * You can also customize the Excel cells.
1074
1075
  *
1075
1076
  * @event excelHeaderQueryCellInfo
1076
-
1077
+ * @deprecated
1077
1078
  */
1078
1079
  excelHeaderQueryCellInfo: EmitType<ExcelHeaderQueryCellInfoEventArgs>;
1079
1080
  /**
@@ -1086,7 +1087,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1086
1087
  * Triggers after TreeGrid data is exported to Excel file.
1087
1088
  *
1088
1089
  * @event excelExportComplete
1089
-
1090
+ * @deprecated
1090
1091
  */
1091
1092
  excelExportComplete: EmitType<ExcelExportCompleteArgs>;
1092
1093
  /**
@@ -1099,7 +1100,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1099
1100
  * Triggers after TreeGrid data is exported to PDF document.
1100
1101
  *
1101
1102
  * @event pdfExportComplete
1102
-
1103
+ * @deprecated
1103
1104
  */
1104
1105
  pdfExportComplete: EmitType<PdfExportCompleteArgs>;
1105
1106
  /**
@@ -2658,7 +2658,12 @@ var TreeGrid = /** @class */ (function (_super) {
2658
2658
  }
2659
2659
  else {
2660
2660
  if (this.enableVirtualization && this.isCollapseAll) {
2661
- record = this.grid.getCurrentViewRecords()[row.rowIndex];
2661
+ if (this.isExpandAll && row.rowIndex === -1) {
2662
+ record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
2663
+ }
2664
+ else {
2665
+ record = this.grid.getCurrentViewRecords()[row.rowIndex];
2666
+ }
2662
2667
  }
2663
2668
  else {
2664
2669
  record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
@@ -2897,7 +2902,12 @@ var TreeGrid = /** @class */ (function (_super) {
2897
2902
  }
2898
2903
  }
2899
2904
  else {
2900
- this.expandRow(rows[parseInt(i.toString(), 10)]);
2905
+ if (!this.enableVirtualization) {
2906
+ this.expandRow(rows[parseInt(i.toString(), 10)]);
2907
+ }
2908
+ else if (rows[0].getAttribute('aria-expanded') !== 'true') {
2909
+ this.expandRow(rows[0]);
2910
+ }
2901
2911
  }
2902
2912
  }
2903
2913
  }
@@ -0,0 +1,30 @@
1
+ import { TextAlign, ClipMode, ValueAccessor, IFilter, IFilterUI, IEditCell, CommandModel, freezeDirection } from '@syncfusion/ej2-grids';import { NumberFormatOptions, DateFormatOptions, merge, Property } from '@syncfusion/ej2-base';import { ITreeGridCellFormatter } from '../base/interface';import { SortComparer} from '@syncfusion/ej2-grids';import { TreeGrid } from '..';
2
+ import {ColumnModel} from "./column";
3
+
4
+ /**
5
+ * Interface for a class Column
6
+ */
7
+ export interface ColumnModel {
8
+
9
+ }
10
+
11
+ /**
12
+ * Interface for a class TreeGridColumn
13
+ */
14
+ export interface TreeGridColumnModel extends ColumnModel{
15
+
16
+ /**
17
+ * Defines stacked columns
18
+ *
19
+ * @default null
20
+ */
21
+ columns?: string[] | ColumnModel[];
22
+
23
+ }
24
+
25
+ /**
26
+ * Interface for a class StackedColumn
27
+ */
28
+ export interface StackedColumnModel extends TreeGridColumnModel{
29
+
30
+ }
@@ -709,3 +709,35 @@ export interface ColumnModel {
709
709
  */
710
710
  freeze?: freezeDirection;
711
711
  }
712
+ /**
713
+ * Defines TreeGrid column
714
+ */
715
+ export declare class TreeGridColumn extends Column {
716
+ /**
717
+ * Defines stacked columns
718
+ *
719
+ * @default null
720
+ */
721
+ columns: string[] | ColumnModel[];
722
+ }
723
+ /**
724
+ * Interface for a class TreeGridColumn
725
+ */
726
+ export interface TreeGridColumnModel extends ColumnModel {
727
+ /**
728
+ * Defines stacked columns
729
+ *
730
+ * @default null
731
+ */
732
+ columns?: string[] | ColumnModel[];
733
+ }
734
+ /**
735
+ * Defines stacked tree grid column
736
+ */
737
+ export declare class StackedColumn extends TreeGridColumn {
738
+ }
739
+ /**
740
+ * Interface for a class stacked tree grid column
741
+ */
742
+ export interface StackedColumnModel extends TreeGridColumnModel {
743
+ }
@@ -1,4 +1,23 @@
1
- import { merge } from '@syncfusion/ej2-base';
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
19
+ };
20
+ import { merge, Property } from '@syncfusion/ej2-base';
2
21
  /**
3
22
  * Represents TreeGrid `Column` model class.
4
23
  */
@@ -93,3 +112,28 @@ var Column = /** @class */ (function () {
93
112
  return Column;
94
113
  }());
95
114
  export { Column };
115
+ /**
116
+ * Defines TreeGrid column
117
+ */
118
+ var TreeGridColumn = /** @class */ (function (_super) {
119
+ __extends(TreeGridColumn, _super);
120
+ function TreeGridColumn() {
121
+ return _super !== null && _super.apply(this, arguments) || this;
122
+ }
123
+ __decorate([
124
+ Property(null)
125
+ ], TreeGridColumn.prototype, "columns", void 0);
126
+ return TreeGridColumn;
127
+ }(Column));
128
+ export { TreeGridColumn };
129
+ /**
130
+ * Defines stacked tree grid column
131
+ */
132
+ var StackedColumn = /** @class */ (function (_super) {
133
+ __extends(StackedColumn, _super);
134
+ function StackedColumn() {
135
+ return _super !== null && _super.apply(this, arguments) || this;
136
+ }
137
+ return StackedColumn;
138
+ }(TreeGridColumn));
139
+ export { StackedColumn };
@@ -41,7 +41,7 @@ var Render = /** @class */ (function () {
41
41
  if (collapsed && !isNullOrUndefined(args.row)) {
42
42
  args.row.style.display = 'none';
43
43
  var rowsObj = this.parent.grid.getRowsObject();
44
- if (!isNullOrUndefined(args.row.getAttribute('data-uid'))) {
44
+ if (!this.parent.grid.isFrozenGrid() && !isNullOrUndefined(args.row.getAttribute('data-uid'))) {
45
45
  rowsObj.filter(function (e) { return e.uid === args.row.getAttribute('data-uid'); })[0].visible = false;
46
46
  }
47
47
  }
@@ -227,6 +227,7 @@ var Render = /** @class */ (function () {
227
227
  if (summaryRow) {
228
228
  addClass([args.cell], 'e-summarycell');
229
229
  var summaryData = getObject(args.column.field, args.data);
230
+ summaryData = isNullOrUndefined(summaryData) ? null : summaryData;
230
231
  if (args.cell.querySelector('.e-treecell') != null) {
231
232
  args.cell.querySelector('.e-treecell').innerHTML = summaryData;
232
233
  }
@@ -384,7 +384,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
384
384
  var currentViewData = this.parent.currentViewData;
385
385
  var indexValue = 'index';
386
386
  if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
387
- var vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? this.parent.height :
387
+ var vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? parseInt(this.parent.height.toString(), 10) :
388
388
  this.parent.element.getBoundingClientRect().height);
389
389
  var index = (~~(content.scrollTop / rowHeight)
390
390
  + Math.ceil(vHeight / rowHeight))
@@ -443,7 +443,9 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
443
443
  }
444
444
  this.startIndex = !isLastBlock ? lastIndex - this.parent.pageSettings.pageSize : nextSetResIndex;
445
445
  this.endIndex = lastIndex;
446
- if ((nextSetResIndex + this.parent.pageSettings.pageSize) > this.totalRecords && (this.endIndex - this.startIndex) < (this.parent.pageSettings.pageSize / 2) && (this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
446
+ if ((nextSetResIndex + this.parent.pageSettings.pageSize) > this.totalRecords &&
447
+ (this.endIndex - this.startIndex) < (this.parent.pageSettings.pageSize / 2) &&
448
+ (this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
447
449
  this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
448
450
  }
449
451
  if (currentViewData.length && this.startIndex > currentViewData[0]["" + indexValue] &&
@@ -458,7 +460,12 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
458
460
  this.translateY = scrollArgs.offset.top - rowHeight * 2;
459
461
  }
460
462
  else {
461
- this.translateY = scrollArgs.offset.top;
463
+ if (this.totalRecords == this.endIndex) {
464
+ this.translateY = (this.totalRecords * rowHeight) - ((this.endIndex - this.startIndex) * rowHeight);
465
+ }
466
+ else {
467
+ this.translateY = scrollArgs.offset.top;
468
+ }
462
469
  }
463
470
  }
464
471
  }