@refinitiv-ui/efx-grid 6.0.4 → 6.0.6
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.
- package/lib/column-dragging/es6/ColumnDragging.d.ts +13 -11
- package/lib/column-dragging/es6/ColumnDragging.js +21 -15
- package/lib/column-format-dialog/lib/column-format-dialog.d.ts +1 -1
- package/lib/column-format-dialog/lib/column-format-dialog.js +3 -4
- package/lib/column-format-dialog/lib/preview-table.js +3 -4
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +2 -2
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +23 -7
- package/lib/core/dist/core.css +1 -1
- package/lib/core/dist/core.js +392 -230
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/ColumnStats.d.ts +3 -3
- package/lib/core/es6/data/DataCache.d.ts +9 -9
- package/lib/core/es6/data/DataTable.d.ts +28 -28
- package/lib/core/es6/data/DataTable.js +33 -10
- package/lib/core/es6/data/DataView.d.ts +62 -62
- package/lib/core/es6/data/DataView.js +42 -22
- package/lib/core/es6/data/Segment.d.ts +4 -4
- package/lib/core/es6/data/SegmentCollection.d.ts +7 -7
- package/lib/core/es6/data/WrappedView.d.ts +62 -62
- package/lib/core/es6/grid/Core.d.ts +97 -95
- package/lib/core/es6/grid/Core.js +180 -26
- package/lib/core/es6/grid/ILayoutGrid.d.ts +20 -20
- package/lib/core/es6/grid/ILayoutGrid.js +2 -1
- package/lib/core/es6/grid/LayoutGrid.d.ts +2 -2
- package/lib/core/es6/grid/LayoutGrid.js +18 -10
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +2 -2
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +14 -3
- package/lib/core/es6/grid/components/Cell.d.ts +6 -6
- package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +2 -2
- package/lib/core/es6/grid/components/CellSpans.d.ts +2 -2
- package/lib/core/es6/grid/components/Column.d.ts +2 -2
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +19 -19
- package/lib/core/es6/grid/components/Scrollbar.d.ts +11 -9
- package/lib/core/es6/grid/components/Scrollbar.js +13 -0
- package/lib/core/es6/grid/components/StretchedCells.js +12 -2
- package/lib/core/es6/grid/event/EventDispatcher.d.ts +3 -3
- package/lib/core/es6/grid/event/EventListeners.d.ts +5 -5
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +45 -44
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +62 -65
- package/lib/core/es6/grid/util/Conflator.d.ts +4 -4
- package/lib/core/es6/grid/util/HttpRequest.d.ts +3 -3
- package/lib/core/es6/grid/util/PercentBar.d.ts +8 -8
- package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +8 -8
- package/lib/core/es6/grid/util/RangeBar.d.ts +1 -1
- package/lib/core/es6/grid/util/RangeBar.js +1 -1
- package/lib/core/es6/grid/util/Reverter.d.ts +1 -1
- package/lib/core/es6/grid/util/SectionSettings.d.ts +13 -13
- package/lib/core/es6/grid/util/SelectionList.d.ts +2 -2
- package/lib/core/es6/grid/util/TrackLayout.d.ts +9 -9
- package/lib/core/es6/grid/util/Virtualizer.d.ts +3 -3
- package/lib/core/es6/grid/util/util.d.ts +6 -4
- package/lib/core/es6/grid/util/util.js +16 -91
- package/lib/core/es6/tr-grid-theme.js +1 -1
- package/lib/filter-dialog/lib/checkbox-list.d.ts +1 -1
- package/lib/filter-dialog/lib/filter-dialog.d.ts +1 -1
- package/lib/filter-dialog/lib/filter-dialog.js +27 -9
- package/lib/filter-dialog/themes/base-checkbox.less +0 -1
- package/lib/filter-dialog/themes/base.less +1 -1
- package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
- package/lib/grid/index.js +1 -1
- package/lib/grid/lib/efx-grid.js +7 -44
- package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
- package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/grid/themes/halo/efx-grid.less +5 -5
- package/lib/grid/themes/halo/light/efx-grid.js +1 -1
- package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +30 -24
- package/lib/row-segmenting/es6/RowSegmenting.js +122 -21
- package/lib/rt-grid/dist/rt-grid.js +1354 -435
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +46 -42
- package/lib/rt-grid/es6/ColumnDefinition.js +31 -1
- package/lib/rt-grid/es6/DataConnector.d.ts +6 -4
- package/lib/rt-grid/es6/DataConnector.js +8 -0
- package/lib/rt-grid/es6/FieldDefinition.d.ts +2 -2
- package/lib/rt-grid/es6/FieldDefinition.js +12 -5
- package/lib/rt-grid/es6/Grid.d.ts +106 -91
- package/lib/rt-grid/es6/Grid.js +151 -106
- package/lib/rt-grid/es6/ReferenceCounter.d.ts +5 -5
- package/lib/rt-grid/es6/RowDefSorter.d.ts +2 -2
- package/lib/rt-grid/es6/RowDefinition.d.ts +22 -22
- package/lib/rt-grid/es6/RowDefinition.js +12 -5
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +5 -2
- package/lib/rt-grid/es6/SnapshotFiller.js +121 -15
- package/lib/rt-grid/es6/StyleLoader.d.ts +1 -1
- package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +11 -11
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +20 -35
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +18 -16
- package/lib/tr-grid-checkbox/es6/Checkbox.js +1 -0
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.d.ts +29 -27
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +1 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +28 -14
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +556 -11
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.d.ts +2 -2
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +1 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +2 -3
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +15 -13
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +96 -72
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +14 -4
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +314 -114
- package/lib/tr-grid-content-wrap/es6/ContentWrap.js +1 -6
- package/lib/tr-grid-contextmenu/es6/ContextMenu.js +3 -3
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +2 -2
- package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +2 -2
- package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +2 -1
- package/lib/tr-grid-heat-map/es6/HeatMap.js +6 -9
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +5 -2
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +311 -71
- package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +1 -1
- package/lib/tr-grid-percent-bar/es6/PercentBar.js +8 -11
- package/lib/tr-grid-printer/es6/SectionWriter.js +8 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.js +3 -10
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +6 -0
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +56 -23
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +4 -3
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +57 -13
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1 -1
- package/lib/tr-grid-row-selection/es6/RowSelection.js +16 -13
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +0 -2
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +1 -40
- package/lib/tr-grid-util/es6/CellPainter.d.ts +30 -30
- package/lib/tr-grid-util/es6/CellPainter.js +9 -8
- package/lib/tr-grid-util/es6/Conflator.d.ts +4 -4
- package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
- package/lib/tr-grid-util/es6/DateTime.d.ts +10 -10
- package/lib/tr-grid-util/es6/Deferred.d.ts +3 -1
- package/lib/tr-grid-util/es6/Deferred.js +11 -1
- package/lib/tr-grid-util/es6/Delay.d.ts +2 -2
- package/lib/tr-grid-util/es6/Dom.d.ts +10 -10
- package/lib/tr-grid-util/es6/Dom.js +14 -10
- package/lib/tr-grid-util/es6/DragUI.js +5 -2
- package/lib/tr-grid-util/es6/ElementObserver.d.ts +2 -2
- package/lib/tr-grid-util/es6/ElementObserver.js +6 -3
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +4 -4
- package/lib/tr-grid-util/es6/ElfDate.d.ts +5 -5
- package/lib/tr-grid-util/es6/ElfDate.js +1 -0
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +13 -4
- package/lib/tr-grid-util/es6/ElfUtil.js +178 -26
- package/lib/tr-grid-util/es6/EventDispatcher.d.ts +5 -5
- package/lib/tr-grid-util/es6/ExpanderIcon.d.ts +2 -2
- package/lib/tr-grid-util/es6/ExpanderIcon.js +1 -1
- package/lib/tr-grid-util/es6/Ext.d.ts +1 -1
- package/lib/tr-grid-util/es6/FieldFormatter.d.ts +12 -12
- package/lib/tr-grid-util/es6/FieldFormatter.js +1 -1
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +13 -13
- package/lib/tr-grid-util/es6/FilterBuilder.js +15 -8
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +22 -22
- package/lib/tr-grid-util/es6/FilterOperators.js +3 -3
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +10 -10
- package/lib/tr-grid-util/es6/GridPlugin.js +20 -0
- package/lib/tr-grid-util/es6/Icon.d.ts +3 -3
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +8 -8
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +6 -6
- package/lib/tr-grid-util/es6/NumberFormatter.d.ts +19 -19
- package/lib/tr-grid-util/es6/NumberFormatter.js +1 -1
- package/lib/tr-grid-util/es6/PercentBar.d.ts +19 -19
- package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
- package/lib/tr-grid-util/es6/Popup.d.ts +36 -33
- package/lib/tr-grid-util/es6/Popup.js +19 -1
- package/lib/tr-grid-util/es6/RangeBar.d.ts +5 -5
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +4 -4
- package/lib/tr-grid-util/es6/RowPainter.d.ts +37 -4
- package/lib/tr-grid-util/es6/RowPainter.js +199 -76
- package/lib/tr-grid-util/es6/SubTable.d.ts +14 -14
- package/lib/tr-grid-util/es6/Table.d.ts +25 -25
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +1 -1
- package/lib/tr-grid-util/es6/Timer.d.ts +1 -1
- package/lib/tr-grid-util/es6/TouchProxy.d.ts +9 -9
- package/lib/tr-grid-util/es6/Util.d.ts +12 -12
- package/lib/tr-grid-util/es6/formula/ADCService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/ADCSubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/AdFinService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/Engine.d.ts +9 -9
- package/lib/tr-grid-util/es6/formula/Formula.d.ts +4 -4
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/Realtime.d.ts +3 -3
- package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/TSIService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/TSISubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/VariableToken.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +34 -34
- package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
- package/lib/tr-grid-util/es6/jet/MockJET.js +12 -4
- package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +9 -9
- package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +17 -9
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +84 -24
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +42 -2
- package/lib/tr-grid-util/es6/jet/MockRTK.js +55 -16
- package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +2 -2
- package/lib/tr-grid-util/es6/jet/mockDataAPI.js +99 -1
- package/lib/types/es6/Checkbox.d.ts +18 -16
- package/lib/types/es6/ColumnFormatting.d.ts +29 -27
- package/lib/types/es6/ColumnGrouping.d.ts +28 -14
- package/lib/types/es6/ColumnResizing.d.ts +2 -2
- package/lib/types/es6/ColumnStack.d.ts +15 -13
- package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +4 -2
- package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +0 -1
- package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +1 -1
- package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +1 -1
- package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +1 -5
- package/lib/types/es6/CompositeGrid/Plugin.d.ts +3 -1
- package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +2 -1
- package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +2 -1
- package/lib/types/es6/CompositeGrid/TextWidthCalculator.d.ts +1 -1
- package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +0 -1
- package/lib/types/es6/ConditionalColoring.d.ts +14 -4
- package/lib/types/es6/Core/data/ColumnStats.d.ts +3 -3
- package/lib/types/es6/Core/data/DataCache.d.ts +9 -9
- package/lib/types/es6/Core/data/DataTable.d.ts +28 -28
- package/lib/types/es6/Core/data/DataView.d.ts +62 -62
- package/lib/types/es6/Core/data/Segment.d.ts +4 -4
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +7 -7
- package/lib/types/es6/Core/data/WrappedView.d.ts +62 -62
- package/lib/types/es6/Core/grid/Core.d.ts +97 -95
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +20 -20
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +2 -2
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/Cell.d.ts +6 -6
- package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/CellSpans.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/Column.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +19 -19
- package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +11 -9
- package/lib/types/es6/Core/grid/event/EventDispatcher.d.ts +3 -3
- package/lib/types/es6/Core/grid/event/EventListeners.d.ts +5 -5
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +45 -44
- package/lib/types/es6/Core/grid/util/Conflator.d.ts +4 -4
- package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +3 -3
- package/lib/types/es6/Core/grid/util/PercentBar.d.ts +8 -8
- package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +8 -8
- package/lib/types/es6/Core/grid/util/RangeBar.d.ts +1 -1
- package/lib/types/es6/Core/grid/util/Reverter.d.ts +1 -1
- package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +13 -13
- package/lib/types/es6/Core/grid/util/SelectionList.d.ts +2 -2
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +9 -9
- package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +3 -3
- package/lib/types/es6/Core/grid/util/util.d.ts +6 -4
- package/lib/types/es6/HeatMap.d.ts +2 -1
- package/lib/types/es6/InCellEditing.d.ts +5 -2
- package/lib/types/es6/MenuEventAPI.d.ts +2 -2
- package/lib/types/es6/MenuItem.d.ts +2 -2
- package/lib/types/es6/PercentBar.d.ts +1 -1
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +46 -42
- package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +6 -4
- package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +2 -2
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +104 -89
- package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +5 -5
- package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +2 -2
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +22 -22
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +5 -2
- package/lib/types/es6/RealtimeGrid/StyleLoader.d.ts +1 -1
- package/lib/types/es6/RowColoring.d.ts +0 -2
- package/lib/types/es6/RowDragging.d.ts +6 -0
- package/lib/types/es6/RowFiltering.d.ts +4 -3
- package/lib/types/es6/RowSegmenting.d.ts +30 -24
- package/lib/versions.json +26 -26
- package/package.json +2 -2
@@ -28,7 +28,10 @@ var ColumnGroupingPlugin = function ColumnGroupingPlugin(options) {
|
|
28
28
|
var t = this;
|
29
29
|
t._hosts = [];
|
30
30
|
t._onColumnChanged = t._onColumnChanged.bind(t);
|
31
|
+
t._onColumnAdded = t._onColumnAdded.bind(t);
|
32
|
+
t._onColumnMoved = t._onColumnMoved.bind(t);
|
31
33
|
t._onPostSectionRender = t._onPostSectionRender.bind(t);
|
34
|
+
t._onBeforeColumnBoundUpdate = t._onBeforeColumnBoundUpdate.bind(t);
|
32
35
|
t._groupDefs = [];
|
33
36
|
t._groupMap = {};
|
34
37
|
t._childToParent = {};
|
@@ -63,12 +66,17 @@ ColumnGroupingPlugin.prototype._childToParent;
|
|
63
66
|
* @private
|
64
67
|
*/
|
65
68
|
|
66
|
-
ColumnGroupingPlugin.prototype._maxDepth =
|
69
|
+
ColumnGroupingPlugin.prototype._maxDepth = 0;
|
67
70
|
/** @type {boolean}
|
68
71
|
* @private
|
69
72
|
*/
|
70
73
|
|
71
74
|
ColumnGroupingPlugin.prototype._restructuring = false;
|
75
|
+
/** @type {number}
|
76
|
+
* @private
|
77
|
+
*/
|
78
|
+
|
79
|
+
ColumnGroupingPlugin.prototype._rerenderTimerId = 0;
|
72
80
|
/** @private
|
73
81
|
* @param {ColumnGroupingPlugin~GroupDefinition} groupingOptions
|
74
82
|
* @return {string}
|
@@ -137,11 +145,12 @@ ColumnGroupingPlugin.prototype.initialize = function (host, options) {
|
|
137
145
|
this._hosts.push(host);
|
138
146
|
|
139
147
|
if (this._hosts.length === 1) {
|
140
|
-
host.listen("columnAdded", this.
|
141
|
-
host.listen("columnMoved", this.
|
148
|
+
host.listen("columnAdded", this._onColumnAdded);
|
149
|
+
host.listen("columnMoved", this._onColumnMoved);
|
142
150
|
host.listen("columnRemoved", this._onColumnChanged);
|
143
151
|
host.listen("columnVisibilityChanged", this._onColumnChanged);
|
144
152
|
host.listen("postSectionRender", this._onPostSectionRender);
|
153
|
+
host.listen("beforeColumnBoundUpdate", this._onBeforeColumnBoundUpdate);
|
145
154
|
}
|
146
155
|
|
147
156
|
this.config(options);
|
@@ -186,9 +195,17 @@ ColumnGroupingPlugin.prototype.unload = function (host) {
|
|
186
195
|
this._hosts.splice(at, 1);
|
187
196
|
|
188
197
|
host.unlisten("columnAdded", this._onColumnChanged);
|
189
|
-
host.unlisten("columnMoved", this.
|
198
|
+
host.unlisten("columnMoved", this._onColumnMoved);
|
190
199
|
host.unlisten("columnRemoved", this._onColumnChanged);
|
191
200
|
host.unlisten("postSectionRender", this._onPostSectionRender);
|
201
|
+
host.unlisten("beforeColumnBoundUpdate", this._onBeforeColumnBoundUpdate);
|
202
|
+
|
203
|
+
if (!this._hosts.length) {
|
204
|
+
if (this._rerenderTimerId) {
|
205
|
+
clearTimeout(this._rerenderTimerId);
|
206
|
+
this._rerenderTimerId = 0;
|
207
|
+
}
|
208
|
+
}
|
192
209
|
|
193
210
|
this._dispose();
|
194
211
|
};
|
@@ -307,6 +324,8 @@ ColumnGroupingPlugin.prototype._migrateLegacyStructure = function (colModels) {
|
|
307
324
|
|
308
325
|
|
309
326
|
ColumnGroupingPlugin.prototype._applyGrouping = function () {
|
327
|
+
this._rerenderTimerId = 0;
|
328
|
+
|
310
329
|
if (this._restructuring) {
|
311
330
|
return;
|
312
331
|
}
|
@@ -345,6 +364,58 @@ ColumnGroupingPlugin.prototype._applyGrouping = function () {
|
|
345
364
|
}
|
346
365
|
}
|
347
366
|
};
|
367
|
+
/** Set a timer to call applyGrouping only once to avoid performance issue
|
368
|
+
* @private
|
369
|
+
*/
|
370
|
+
|
371
|
+
|
372
|
+
ColumnGroupingPlugin.prototype._requestApplyGrouping = function () {
|
373
|
+
if (!this._rerenderTimerId) {
|
374
|
+
this._rerenderTimerId = setTimeout(this._applyGrouping.bind(this), 10);
|
375
|
+
}
|
376
|
+
};
|
377
|
+
/** Apply nearest grouping to column.
|
378
|
+
* @private
|
379
|
+
* @param {number} colIndex
|
380
|
+
*/
|
381
|
+
|
382
|
+
|
383
|
+
ColumnGroupingPlugin.prototype._applyNearestGrouping = function (colIndex) {
|
384
|
+
if (colIndex == null || colIndex < 0) {
|
385
|
+
return;
|
386
|
+
}
|
387
|
+
|
388
|
+
var colIndexLeft = colIndex - 1;
|
389
|
+
var colIndexRight = colIndex + 1;
|
390
|
+
var groupLeftIds = this.getGroupIds(colIndexLeft);
|
391
|
+
var groupRightIds = this.getGroupIds(colIndexRight);
|
392
|
+
|
393
|
+
if (groupLeftIds && groupRightIds) {
|
394
|
+
var i, j, groupLeftId, groupRightId, field;
|
395
|
+
var found = false;
|
396
|
+
|
397
|
+
for (i = 0; i < groupLeftIds.length; i++) {
|
398
|
+
groupLeftId = groupLeftIds[i];
|
399
|
+
|
400
|
+
for (j = 0; j < groupRightIds.length; j++) {
|
401
|
+
groupRightId = groupRightIds[j];
|
402
|
+
|
403
|
+
if (groupLeftId === groupRightId) {
|
404
|
+
// found same Id between group
|
405
|
+
field = this.getColumnId(colIndex);
|
406
|
+
|
407
|
+
this._addGroupChild(field, groupRightId);
|
408
|
+
|
409
|
+
found = true;
|
410
|
+
}
|
411
|
+
}
|
412
|
+
|
413
|
+
if (found) {
|
414
|
+
break;
|
415
|
+
}
|
416
|
+
}
|
417
|
+
}
|
418
|
+
};
|
348
419
|
/** @private
|
349
420
|
* @param {Object=} titleSection
|
350
421
|
*/
|
@@ -363,13 +434,13 @@ ColumnGroupingPlugin.prototype._spanGroupVertically = function (titleSection) {
|
|
363
434
|
var colCount = api.getColumnCount();
|
364
435
|
|
365
436
|
for (var col = 0; col < colCount; col++) {
|
366
|
-
var toSpan =
|
437
|
+
var toSpan = rowCount;
|
367
438
|
|
368
439
|
var parentNode = this._getParentGroup(this.getColumnId(col));
|
369
440
|
|
370
441
|
if (parentNode) {
|
371
442
|
var depth = parentNode["onRow"] + 1;
|
372
|
-
toSpan =
|
443
|
+
toSpan = rowCount - depth;
|
373
444
|
} // Note that invisible column cannot have row span
|
374
445
|
|
375
446
|
|
@@ -461,11 +532,151 @@ ColumnGroupingPlugin.prototype._onPostSectionRender = function (e) {
|
|
461
532
|
}
|
462
533
|
};
|
463
534
|
/** @private
|
535
|
+
* @param {Object} e dispatching of columnAdded event object
|
536
|
+
*/
|
537
|
+
|
538
|
+
|
539
|
+
ColumnGroupingPlugin.prototype._onColumnAdded = function (e) {
|
540
|
+
var colIndex = e.colIndex;
|
541
|
+
|
542
|
+
this._applyNearestGrouping(colIndex);
|
543
|
+
|
544
|
+
this._requestApplyGrouping();
|
545
|
+
};
|
546
|
+
/** @private
|
464
547
|
*/
|
465
548
|
|
466
549
|
|
467
550
|
ColumnGroupingPlugin.prototype._onColumnChanged = function () {
|
468
|
-
this.
|
551
|
+
this._requestApplyGrouping();
|
552
|
+
};
|
553
|
+
/** @private
|
554
|
+
* @param {Object} e dispatching of columnMoved event object
|
555
|
+
*/
|
556
|
+
|
557
|
+
|
558
|
+
ColumnGroupingPlugin.prototype._onColumnMoved = function (e) {
|
559
|
+
var toColIndex = e.toColIndex;
|
560
|
+
var colId = this.getColumnId(toColIndex);
|
561
|
+
var groupId = this._childToParent[colId];
|
562
|
+
var colIndexLeft = toColIndex - 1;
|
563
|
+
var colIndexRight = toColIndex + 1;
|
564
|
+
var colIdLeft = this.getColumnId(colIndexLeft);
|
565
|
+
var colIdRight = this.getColumnId(colIndexRight);
|
566
|
+
var groupIdLeft = this._childToParent[colIdLeft];
|
567
|
+
var groupIdRight = this._childToParent[colIdRight];
|
568
|
+
|
569
|
+
if (groupId != groupIdLeft && groupId != groupIdRight) {
|
570
|
+
// remove column from previous group
|
571
|
+
if (groupId) {
|
572
|
+
var groupChild = this.getGroupChildren(groupId);
|
573
|
+
var removeIndex = groupChild.indexOf(colId);
|
574
|
+
|
575
|
+
if (removeIndex > -1) {
|
576
|
+
groupChild.splice(removeIndex, 1);
|
577
|
+
}
|
578
|
+
|
579
|
+
this.setGroupChildren(groupId, groupChild);
|
580
|
+
}
|
581
|
+
|
582
|
+
this._applyNearestGrouping(toColIndex);
|
583
|
+
}
|
584
|
+
|
585
|
+
this._requestApplyGrouping();
|
586
|
+
};
|
587
|
+
/** @private
|
588
|
+
* @param {Object} e
|
589
|
+
*/
|
590
|
+
|
591
|
+
|
592
|
+
ColumnGroupingPlugin.prototype._onBeforeColumnBoundUpdate = function (e) {
|
593
|
+
var selectedColumns = e.selectedColumns;
|
594
|
+
var parentMap = this._childToParent; // Find non-grouped column
|
595
|
+
|
596
|
+
var i, colId, nonGroupedColId, groupId;
|
597
|
+
var colIds = [];
|
598
|
+
var groupMap = {};
|
599
|
+
|
600
|
+
for (i = 0; i < selectedColumns.length; i++) {
|
601
|
+
colId = this.getColumnId(selectedColumns[i]);
|
602
|
+
|
603
|
+
if (colId) {
|
604
|
+
groupId = parentMap[colId];
|
605
|
+
|
606
|
+
if (!groupId) {
|
607
|
+
nonGroupedColId = colId;
|
608
|
+
break;
|
609
|
+
} else {
|
610
|
+
groupMap[groupId] = this._groupMap[groupId]; // Cache group node for further calculation
|
611
|
+
}
|
612
|
+
|
613
|
+
colIds.push(colId); // Cache column id for further calculation
|
614
|
+
}
|
615
|
+
}
|
616
|
+
|
617
|
+
if (nonGroupedColId) {
|
618
|
+
e.topBoundRowIndex = 0;
|
619
|
+
return;
|
620
|
+
}
|
621
|
+
|
622
|
+
var topBoundRowIndex = this._maxDepth; // Column title row
|
623
|
+
// Find minimum row index of group
|
624
|
+
|
625
|
+
var rootGroupMap = {};
|
626
|
+
var headerRowIndex, group;
|
627
|
+
|
628
|
+
for (groupId in groupMap) {
|
629
|
+
group = this._getRootGroup(groupId);
|
630
|
+
rootGroupMap[group.id] = group;
|
631
|
+
headerRowIndex = groupMap[groupId].onRow + 1;
|
632
|
+
|
633
|
+
if (headerRowIndex < topBoundRowIndex) {
|
634
|
+
topBoundRowIndex = headerRowIndex;
|
635
|
+
}
|
636
|
+
} // Traverse down from the root group to find group that its all members are selected
|
637
|
+
|
638
|
+
|
639
|
+
var n, members, allSelected, findingGroup, children;
|
640
|
+
var nextLevelGroups = rootGroupMap;
|
641
|
+
|
642
|
+
for (i = 0; i < topBoundRowIndex; i++) {
|
643
|
+
findingGroup = nextLevelGroups;
|
644
|
+
nextLevelGroups = {};
|
645
|
+
|
646
|
+
for (groupId in findingGroup) {
|
647
|
+
group = findingGroup[groupId];
|
648
|
+
allSelected = true;
|
649
|
+
members = this._getGroupMembers(group);
|
650
|
+
|
651
|
+
if (members.length <= colIds.length) {
|
652
|
+
for (n = 0; n < members.length; n++) {
|
653
|
+
if (colIds.indexOf(members[n]) < 0) {
|
654
|
+
allSelected = false;
|
655
|
+
break;
|
656
|
+
}
|
657
|
+
}
|
658
|
+
|
659
|
+
if (allSelected) {
|
660
|
+
e.topBoundRowIndex = i;
|
661
|
+
return;
|
662
|
+
}
|
663
|
+
} // Cache the next level group
|
664
|
+
|
665
|
+
|
666
|
+
children = group.children;
|
667
|
+
|
668
|
+
for (n = 0; n < children.length; n++) {
|
669
|
+
var id = children[n];
|
670
|
+
group = this._groupMap[id];
|
671
|
+
|
672
|
+
if (group) {
|
673
|
+
nextLevelGroups[id] = group;
|
674
|
+
}
|
675
|
+
}
|
676
|
+
}
|
677
|
+
}
|
678
|
+
|
679
|
+
e.topBoundRowIndex = topBoundRowIndex;
|
469
680
|
};
|
470
681
|
/** Deprecated. Column should be directly added through grid APIs.
|
471
682
|
* @deprecated
|
@@ -614,7 +825,7 @@ ColumnGroupingPlugin.prototype.setGroupDefinition = function (groupId, newDef) {
|
|
614
825
|
}
|
615
826
|
};
|
616
827
|
/** @public
|
617
|
-
* @param {
|
828
|
+
* @param {string} groupId
|
618
829
|
* @return {ColumnGroupingPlugin~GroupDefinition}
|
619
830
|
*/
|
620
831
|
|
@@ -649,8 +860,8 @@ ColumnGroupingPlugin.prototype.setGroupChildren = function (groupId, newChildLis
|
|
649
860
|
}
|
650
861
|
};
|
651
862
|
/** @public
|
652
|
-
* @param {
|
653
|
-
* @return {
|
863
|
+
* @param {string} groupId
|
864
|
+
* @return {Array.<string>}
|
654
865
|
*/
|
655
866
|
|
656
867
|
|
@@ -663,6 +874,144 @@ ColumnGroupingPlugin.prototype.getGroupChildren = function (groupId) {
|
|
663
874
|
|
664
875
|
return null;
|
665
876
|
};
|
877
|
+
/** Return all column indices under the given group id
|
878
|
+
* @public
|
879
|
+
* @param {string} groupId
|
880
|
+
* @return {Array.<number>}
|
881
|
+
*/
|
882
|
+
|
883
|
+
|
884
|
+
ColumnGroupingPlugin.prototype.getChildColumnIndices = function (groupId) {
|
885
|
+
var group = this._groupMap[groupId];
|
886
|
+
|
887
|
+
if (group) {
|
888
|
+
var colIds = this._getGroupMembers(group);
|
889
|
+
|
890
|
+
var colIndices = [];
|
891
|
+
var id;
|
892
|
+
|
893
|
+
for (var i = 0; i < colIds.length; i++) {
|
894
|
+
id = this._getColumnIndexById(colIds[i]);
|
895
|
+
|
896
|
+
if (id > -1) {
|
897
|
+
colIndices.push(id);
|
898
|
+
}
|
899
|
+
}
|
900
|
+
|
901
|
+
return colIndices.sort();
|
902
|
+
}
|
903
|
+
|
904
|
+
return null;
|
905
|
+
};
|
906
|
+
/** @public
|
907
|
+
* @param {string|number} colRef
|
908
|
+
* @return {Array.<string>}
|
909
|
+
*/
|
910
|
+
|
911
|
+
|
912
|
+
ColumnGroupingPlugin.prototype.getGroupIds = function (colRef) {
|
913
|
+
if (colRef != null) {
|
914
|
+
var colId = colRef;
|
915
|
+
|
916
|
+
if (typeof colRef === "number") {
|
917
|
+
colId = this.getColumnId(colRef);
|
918
|
+
}
|
919
|
+
|
920
|
+
if (colId) {
|
921
|
+
var groupId = this._childToParent[colId];
|
922
|
+
|
923
|
+
if (groupId) {
|
924
|
+
var groupIds = [groupId];
|
925
|
+
var group = this._groupMap[groupId];
|
926
|
+
|
927
|
+
while (group && group.parent) {
|
928
|
+
group = this.getGroupDefinition(group.parent);
|
929
|
+
|
930
|
+
if (group) {
|
931
|
+
groupIds.push(group.id);
|
932
|
+
}
|
933
|
+
}
|
934
|
+
|
935
|
+
return groupIds;
|
936
|
+
}
|
937
|
+
}
|
938
|
+
}
|
939
|
+
|
940
|
+
return null;
|
941
|
+
};
|
942
|
+
/** Return deepest row index of column headers
|
943
|
+
* @public
|
944
|
+
* @return {number}
|
945
|
+
*/
|
946
|
+
|
947
|
+
|
948
|
+
ColumnGroupingPlugin.prototype.getMaxGroupLevel = function () {
|
949
|
+
return this._maxDepth;
|
950
|
+
};
|
951
|
+
/** Return row index of the given group id
|
952
|
+
* @public
|
953
|
+
* @param {string} groupId
|
954
|
+
* @return {number}
|
955
|
+
*/
|
956
|
+
|
957
|
+
|
958
|
+
ColumnGroupingPlugin.prototype.getGroupLevel = function (groupId) {
|
959
|
+
var group = this._groupMap[groupId];
|
960
|
+
|
961
|
+
if (group) {
|
962
|
+
return group.onRow;
|
963
|
+
}
|
964
|
+
|
965
|
+
return -1;
|
966
|
+
};
|
967
|
+
/** @private
|
968
|
+
* @param {ColumnGroupingPlugin~GroupDefinition} group Group definition
|
969
|
+
* @param {Array=} members
|
970
|
+
* @return {Array.<string>}
|
971
|
+
*/
|
972
|
+
|
973
|
+
|
974
|
+
ColumnGroupingPlugin.prototype._getGroupMembers = function (group, members) {
|
975
|
+
if (!members) {
|
976
|
+
members = [];
|
977
|
+
}
|
978
|
+
|
979
|
+
var children = group.children;
|
980
|
+
var groupMap = this._groupMap;
|
981
|
+
var g, id;
|
982
|
+
|
983
|
+
for (var i = 0; i < children.length; i++) {
|
984
|
+
id = children[i];
|
985
|
+
g = groupMap[id];
|
986
|
+
|
987
|
+
if (g) {
|
988
|
+
this._getGroupMembers(g, members);
|
989
|
+
} else {
|
990
|
+
members.push(id);
|
991
|
+
}
|
992
|
+
}
|
993
|
+
|
994
|
+
return members;
|
995
|
+
};
|
996
|
+
/** @private
|
997
|
+
* @param {String} groupId
|
998
|
+
* @return {ColumnGroupingPlugin~GroupDefinition}
|
999
|
+
*/
|
1000
|
+
|
1001
|
+
|
1002
|
+
ColumnGroupingPlugin.prototype._getRootGroup = function (groupId) {
|
1003
|
+
if (!groupId) {
|
1004
|
+
return null;
|
1005
|
+
}
|
1006
|
+
|
1007
|
+
var group = this._groupMap[groupId];
|
1008
|
+
|
1009
|
+
while (group.parent) {
|
1010
|
+
group = this.getGroupDefinition(group.parent);
|
1011
|
+
}
|
1012
|
+
|
1013
|
+
return group;
|
1014
|
+
};
|
666
1015
|
/** @private
|
667
1016
|
*/
|
668
1017
|
|
@@ -910,7 +1259,7 @@ ColumnGroupingPlugin.prototype._addGroupChild = function (childId, groupId) {
|
|
910
1259
|
}
|
911
1260
|
};
|
912
1261
|
/** @private
|
913
|
-
* @param {
|
1262
|
+
* @param {string} childId
|
914
1263
|
* @return {ColumnGroupingPlugin~GroupDefinition}
|
915
1264
|
*/
|
916
1265
|
|
@@ -918,6 +1267,202 @@ ColumnGroupingPlugin.prototype._addGroupChild = function (childId, groupId) {
|
|
918
1267
|
ColumnGroupingPlugin.prototype._getParentGroup = function (childId) {
|
919
1268
|
return this.getGroupDefinition(this._childToParent[childId]);
|
920
1269
|
};
|
1270
|
+
/** @private
|
1271
|
+
* @param {string} colId
|
1272
|
+
* @param {number} groupLevel
|
1273
|
+
* @return {string}
|
1274
|
+
*/
|
1275
|
+
|
1276
|
+
|
1277
|
+
ColumnGroupingPlugin.prototype._getGroupId = function (colId, groupLevel) {
|
1278
|
+
var groupId = this._childToParent[colId];
|
1279
|
+
|
1280
|
+
if (!groupId) {
|
1281
|
+
return "";
|
1282
|
+
}
|
1283
|
+
|
1284
|
+
if (groupLevel == null) {
|
1285
|
+
return groupId;
|
1286
|
+
}
|
1287
|
+
|
1288
|
+
var currentLevel = this.getGroupLevel(groupId);
|
1289
|
+
|
1290
|
+
while (currentLevel > groupLevel && groupId) {
|
1291
|
+
groupId = this._childToParent[groupId];
|
1292
|
+
currentLevel--;
|
1293
|
+
}
|
1294
|
+
|
1295
|
+
return groupId || "";
|
1296
|
+
};
|
1297
|
+
/** @public
|
1298
|
+
* @param {Element|Event|MouseEvent} e
|
1299
|
+
* @return {Object}
|
1300
|
+
*/
|
1301
|
+
|
1302
|
+
|
1303
|
+
ColumnGroupingPlugin.prototype.getCellInfo = function (e) {
|
1304
|
+
var api = this.getGridApi();
|
1305
|
+
var grid = e["grid"] || this.getRelativeGrid(e);
|
1306
|
+
|
1307
|
+
if (!api || !grid) {
|
1308
|
+
return null;
|
1309
|
+
}
|
1310
|
+
|
1311
|
+
var cellInfo = grid.getCellInfo(e);
|
1312
|
+
|
1313
|
+
if (!cellInfo.cell) {
|
1314
|
+
var cell = cellInfo.section.getCell(cellInfo.colIndex, cellInfo.rowIndex);
|
1315
|
+
cellInfo["cell"] = cell;
|
1316
|
+
}
|
1317
|
+
|
1318
|
+
var colId = this.getColumnId(cellInfo.colIndex);
|
1319
|
+
|
1320
|
+
var groupId = this._getGroupId(colId, cellInfo.sectionType == "title" ? cellInfo.rowIndex : null);
|
1321
|
+
|
1322
|
+
if (!groupId) {
|
1323
|
+
cellInfo["columnId"] = colId;
|
1324
|
+
return cellInfo;
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
var groupInfo = this.getGroupDefinition(groupId);
|
1328
|
+
|
1329
|
+
if (groupInfo) {
|
1330
|
+
var isGroupHeader = cellInfo.sectionType == "title" && cellInfo.rowIndex == this.getGroupLevel(groupId);
|
1331
|
+
|
1332
|
+
if (isGroupHeader) {
|
1333
|
+
cellInfo["groupId"] = groupInfo.id;
|
1334
|
+
cellInfo["groupName"] = groupInfo.name;
|
1335
|
+
cellInfo["children"] = groupInfo.children;
|
1336
|
+
} else {
|
1337
|
+
cellInfo["columnId"] = colId;
|
1338
|
+
}
|
1339
|
+
|
1340
|
+
cellInfo["parent"] = isGroupHeader ? groupInfo.parent || null : groupInfo.id;
|
1341
|
+
}
|
1342
|
+
|
1343
|
+
return cellInfo;
|
1344
|
+
};
|
1345
|
+
/** @public
|
1346
|
+
* @param {number|string} from //Column index or id that should be moved
|
1347
|
+
* @param {number} to
|
1348
|
+
* @param {string} groupId
|
1349
|
+
*/
|
1350
|
+
|
1351
|
+
|
1352
|
+
ColumnGroupingPlugin.prototype.moveColumnIntoGroup = function (from, to, groupId) {
|
1353
|
+
var fromIndex = -1;
|
1354
|
+
|
1355
|
+
if (typeof from == "string") {
|
1356
|
+
fromIndex = this._getColumnIndexById(from);
|
1357
|
+
} else {
|
1358
|
+
fromIndex = from;
|
1359
|
+
}
|
1360
|
+
|
1361
|
+
if (fromIndex == -1) {
|
1362
|
+
return;
|
1363
|
+
}
|
1364
|
+
|
1365
|
+
var groupDef = this.getGroupDefinition(groupId);
|
1366
|
+
|
1367
|
+
if (!groupDef) {
|
1368
|
+
for (var j = this._hosts.length; --j >= 0;) {
|
1369
|
+
var grid = this._hosts[j];
|
1370
|
+
grid.moveColumn(fromIndex, to);
|
1371
|
+
}
|
1372
|
+
|
1373
|
+
return;
|
1374
|
+
}
|
1375
|
+
|
1376
|
+
var childIndices = this.getChildColumnIndices(groupId);
|
1377
|
+
var startIndex = -1;
|
1378
|
+
var endIndex = -1;
|
1379
|
+
|
1380
|
+
if (childIndices && childIndices.length) {
|
1381
|
+
startIndex = childIndices[0];
|
1382
|
+
endIndex = childIndices[childIndices.length - 1];
|
1383
|
+
}
|
1384
|
+
|
1385
|
+
if (to < startIndex) {
|
1386
|
+
to = startIndex; // handle move column to right
|
1387
|
+
|
1388
|
+
if (to > fromIndex) {
|
1389
|
+
to -= 1;
|
1390
|
+
}
|
1391
|
+
} else if (to > endIndex) {
|
1392
|
+
to = endIndex; // handle move column to left
|
1393
|
+
|
1394
|
+
if (to < fromIndex) {
|
1395
|
+
to += 1;
|
1396
|
+
}
|
1397
|
+
} //find column index that should be moved, it should not be between columns in child group
|
1398
|
+
|
1399
|
+
|
1400
|
+
for (var i = 0; i < groupDef.children.length; i++) {
|
1401
|
+
var notAllowIndices = this.getChildColumnIndices(groupDef.children[i]);
|
1402
|
+
|
1403
|
+
if (notAllowIndices && notAllowIndices.length) {
|
1404
|
+
var notAllowStart = notAllowIndices[0];
|
1405
|
+
var notAllowEnd = notAllowIndices[notAllowIndices.length - 1];
|
1406
|
+
|
1407
|
+
if (to > fromIndex) {
|
1408
|
+
notAllowStart -= 1;
|
1409
|
+
}
|
1410
|
+
|
1411
|
+
if (to < fromIndex) {
|
1412
|
+
notAllowEnd += 1;
|
1413
|
+
}
|
1414
|
+
|
1415
|
+
if (to > notAllowStart && to < notAllowEnd) {
|
1416
|
+
to = notAllowEnd;
|
1417
|
+
}
|
1418
|
+
}
|
1419
|
+
}
|
1420
|
+
|
1421
|
+
for (var gridIndex = this._hosts.length; --gridIndex >= 0;) {
|
1422
|
+
var host = this._hosts[gridIndex];
|
1423
|
+
host.moveColumn(fromIndex, to);
|
1424
|
+
} //remove previous group apply to column
|
1425
|
+
|
1426
|
+
|
1427
|
+
var colId = this.getColumnId(to);
|
1428
|
+
var previousGroup = this._childToParent[colId];
|
1429
|
+
|
1430
|
+
if (previousGroup) {
|
1431
|
+
var previousGroupChild = this.getGroupChildren(previousGroup);
|
1432
|
+
previousGroupChild.splice(previousGroupChild.indexOf(colId), 1);
|
1433
|
+
this.setGroupChildren(previousGroup, previousGroupChild);
|
1434
|
+
} //apply new group
|
1435
|
+
|
1436
|
+
|
1437
|
+
var children = this.getGroupChildren(groupId);
|
1438
|
+
|
1439
|
+
if (children.indexOf(colId) == -1) {
|
1440
|
+
if (colId) {
|
1441
|
+
children.push(colId);
|
1442
|
+
}
|
1443
|
+
}
|
1444
|
+
|
1445
|
+
this.setGroupChildren(groupId, children);
|
1446
|
+
|
1447
|
+
this._requestApplyGrouping();
|
1448
|
+
};
|
1449
|
+
/** @public
|
1450
|
+
* @param {number|string} columnIndex //Column index or id that should be moved
|
1451
|
+
* @param {string} groupId
|
1452
|
+
*/
|
1453
|
+
|
1454
|
+
|
1455
|
+
ColumnGroupingPlugin.prototype.setColumnParent = function (columnIndex, groupId) {
|
1456
|
+
var api = this.getGridApi();
|
1457
|
+
|
1458
|
+
if (!api) {
|
1459
|
+
return;
|
1460
|
+
}
|
1461
|
+
|
1462
|
+
var grid = this._hosts[0];
|
1463
|
+
var colCount = grid.getColumnCount();
|
1464
|
+
this.moveColumnIntoGroup(columnIndex, colCount, groupId);
|
1465
|
+
};
|
921
1466
|
|
922
1467
|
export default ColumnGroupingPlugin;
|
923
1468
|
export { ColumnGroupingPlugin, ColumnGroupingPlugin as ColumnGrouping, ColumnGroupingPlugin as ColumnGroupingExtension };
|
@@ -50,11 +50,11 @@ declare class ColumnResizingPlugin extends GridPlugin {
|
|
50
50
|
|
51
51
|
public setAllColumnWidths(colWidth: number, scalability?: boolean): boolean;
|
52
52
|
|
53
|
-
public getColumnWidths(): (number)[];
|
53
|
+
public getColumnWidths(): (number)[]|null;
|
54
54
|
|
55
55
|
public resetAllColumnsToDefaultWidth(): boolean;
|
56
56
|
|
57
|
-
public getColumnSizeStates(): (any)[];
|
57
|
+
public getColumnSizeStates(): (any)[]|null;
|
58
58
|
|
59
59
|
public setColumnSizeStates(columns: (any)[]|string): void;
|
60
60
|
|
@@ -1009,5 +1009,6 @@ ColumnResizingPlugin.prototype._getResizingCols = function (clickIndex) {
|
|
1009
1009
|
};
|
1010
1010
|
|
1011
1011
|
|
1012
|
+
|
1012
1013
|
export default ColumnResizingPlugin;
|
1013
1014
|
export { ColumnResizingPlugin, ColumnResizingPlugin as ColumnResizing, ColumnResizingPlugin as ColumnResizingExtension };
|
@@ -159,16 +159,15 @@ ColumnSelectionPlugin.prototype.initialize = function (host, options) {
|
|
159
159
|
} else {
|
160
160
|
ColumnSelectionPlugin._stylePromise = ElfUtil.getThemeColors();
|
161
161
|
|
162
|
-
ColumnSelectionPlugin._stylePromise.then(this._onThemeLoaded);
|
162
|
+
ColumnSelectionPlugin._stylePromise.then(this._onThemeLoaded)["catch"](this._onThemeLoaded);
|
163
163
|
}
|
164
164
|
}
|
165
165
|
};
|
166
166
|
/** @private
|
167
|
-
* @param {Object} colors
|
168
167
|
*/
|
169
168
|
|
170
169
|
|
171
|
-
ColumnSelectionPlugin.prototype._onThemeLoaded = function (
|
170
|
+
ColumnSelectionPlugin.prototype._onThemeLoaded = function () {
|
172
171
|
if (!ColumnSelectionPlugin._styles) {
|
173
172
|
var styles = [".column-selection-menu", ["position: absolute;", "background-color: var(--grid-column-menu-icon-bgcolor);", "color: var(--grid-column-menu-icon-color);", "z-index: 1;", "cursor: pointer;", "text-align: center;", "width: 16px;", "height: 16px;", "padding: 6px;"], ".column-selection-menu:hover", ["background-color: var(--grid-column-menu-icon-hover-bgcolor);"], ".column-selection-menu-inside", ["padding: 4px;" // if not outside icon, move to inside
|
174
173
|
]];
|