@refinitiv-ui/efx-grid 6.0.5 → 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 +372 -229
- 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 +95 -95
- package/lib/core/es6/grid/Core.js +173 -25
- 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 +9 -9
- 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 +3 -0
- 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 +689 -367
- 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 +102 -94
- package/lib/rt-grid/es6/Grid.js +70 -105
- 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 +3 -3
- 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 +11 -2
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +309 -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 +2 -3
- 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/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 +10 -4
- package/lib/tr-grid-util/es6/ElfUtil.js +53 -4
- 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 +11 -2
- 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 +95 -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 +9 -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 +100 -92
- 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 +3 -3
- 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
package/lib/core/dist/core.js
CHANGED
@@ -166,40 +166,6 @@ Util.moveArrayItem = function (ary, from, to) {
|
|
166
166
|
}
|
167
167
|
return ary;
|
168
168
|
};
|
169
|
-
/** Insert an item in the given array at the specified position. If the position exceeds the array length, the array will be expanded
|
170
|
-
* @public
|
171
|
-
* @ignore
|
172
|
-
* @param {Array|*} ary
|
173
|
-
* @param {number} at INCLUSIVE
|
174
|
-
* @param {*} item
|
175
|
-
*/
|
176
|
-
Util.insertArrayItem = function (ary, at, item) {
|
177
|
-
if (!ary) { return; }
|
178
|
-
|
179
|
-
if (at < 0) {
|
180
|
-
return; // Negative index cannot be added
|
181
|
-
}
|
182
|
-
if (at < ary.length) {
|
183
|
-
ary.splice(at, 0, item); // any subsequence item is shifted to the right
|
184
|
-
} else {
|
185
|
-
ary[at] = item;
|
186
|
-
}
|
187
|
-
};
|
188
|
-
/** Remove the specified item from the given array
|
189
|
-
* @public
|
190
|
-
* @ignore
|
191
|
-
* @param {Array|*} ary
|
192
|
-
* @param {number} at INCLUSIVE
|
193
|
-
* @return {*} removed item. If not existed, null is returned
|
194
|
-
*/
|
195
|
-
Util.removeArrayItem = function (ary, at) {
|
196
|
-
if (!ary) { return null; }
|
197
|
-
|
198
|
-
if (at >= 0 && at < ary.length) {
|
199
|
-
return ary.splice(at, 1)[0];
|
200
|
-
}
|
201
|
-
return null;
|
202
|
-
};
|
203
169
|
/** @public
|
204
170
|
* @function
|
205
171
|
* @param {Array} ary
|
@@ -267,35 +233,6 @@ Util.cycleArray = function (ary, numItems) {
|
|
267
233
|
return ary || null;
|
268
234
|
};
|
269
235
|
|
270
|
-
/** Correct the index when associated item is moved by the specified indices
|
271
|
-
* @public
|
272
|
-
* @ignore
|
273
|
-
* @param {number|null} num
|
274
|
-
* @param {number|null} from INCLUSIVE removed index
|
275
|
-
* @param {number|null=} opt_to INCLUSIVE added index
|
276
|
-
* @return {number} Negative if the index is removed
|
277
|
-
*/
|
278
|
-
Util.moveIndex = function (num, from, opt_to) {
|
279
|
-
if (!Util.isNumber(num)) { return -1; }
|
280
|
-
if (num === from) {
|
281
|
-
if (Util.isNumber(opt_to)) {
|
282
|
-
return /** @type{number} */(opt_to);
|
283
|
-
}
|
284
|
-
return -1;
|
285
|
-
}
|
286
|
-
if (from !== null) {
|
287
|
-
if (num > from) {
|
288
|
-
--num;
|
289
|
-
}
|
290
|
-
}
|
291
|
-
if (opt_to !== null) {
|
292
|
-
if (num >= opt_to) {
|
293
|
-
++num;
|
294
|
-
}
|
295
|
-
}
|
296
|
-
return /** @type{number} */(num);
|
297
|
-
};
|
298
|
-
|
299
236
|
/** STL implementation of lowerBound() of the C++ vector class with no recursion
|
300
237
|
* @public
|
301
238
|
* @ignore
|
@@ -368,28 +305,6 @@ Util.stringFormat = function (format) {
|
|
368
305
|
Util._defaultLessComparator = function (left, right) {
|
369
306
|
return left < right;
|
370
307
|
};
|
371
|
-
/** @public
|
372
|
-
* @function
|
373
|
-
* @ignore
|
374
|
-
* @param {number} left
|
375
|
-
* @param {number} right
|
376
|
-
* @return {number}
|
377
|
-
* @example [4, 1, 2].sort(Util._numericSorter) === [1, 2, 4];
|
378
|
-
*/
|
379
|
-
Util._numericSorter = function (left, right) {
|
380
|
-
return left - right;
|
381
|
-
};
|
382
|
-
|
383
|
-
/** @public
|
384
|
-
* @function
|
385
|
-
* @ignore
|
386
|
-
* @param {Event} e
|
387
|
-
*/
|
388
|
-
Util._preventDefault = function (e) {
|
389
|
-
e.preventDefault();
|
390
|
-
e.stopPropagation();
|
391
|
-
};
|
392
|
-
|
393
308
|
/**
|
394
309
|
* @public
|
395
310
|
* @function
|
@@ -427,24 +342,34 @@ Util.calculatePercent = function (lowVal, lastVal, highVal) {
|
|
427
342
|
return percent * 100;
|
428
343
|
};
|
429
344
|
|
430
|
-
/** @description
|
345
|
+
/** @description The method returns closest ancestor element or the element itself with specified class string. Otherwise, it returns null
|
431
346
|
* @public
|
432
347
|
* @function
|
433
|
-
* @ignore
|
434
348
|
* @param {Element|Node|undefined} elem
|
435
349
|
* @param {string} classStr The class string can only be one single class without spaces
|
436
350
|
* @return {Element}
|
437
351
|
*/
|
438
352
|
Util.closestElement = function (elem, classStr) {
|
439
353
|
var n = elem;
|
440
|
-
while (n
|
441
|
-
if
|
442
|
-
|
354
|
+
while (n) {
|
355
|
+
if(n.classList) { // DocumentFragment does not have classList property
|
356
|
+
if (n.classList.contains(classStr)) {
|
357
|
+
return /** @type{Element} */(n);
|
358
|
+
}
|
443
359
|
}
|
444
|
-
n = n.parentNode;
|
360
|
+
n = n.parentNode || n.host; // ShadowRoot has host, but not parentNode
|
445
361
|
}
|
446
362
|
return null;
|
447
363
|
};
|
364
|
+
/** @public
|
365
|
+
* @function
|
366
|
+
* @ignore
|
367
|
+
* @param {Event} e
|
368
|
+
*/
|
369
|
+
Util._preventDefault = function (e) {
|
370
|
+
e.preventDefault();
|
371
|
+
e.stopPropagation();
|
372
|
+
};
|
448
373
|
|
449
374
|
/** @public
|
450
375
|
* @type {boolean}
|
@@ -4202,8 +4127,9 @@ ILayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPosit
|
|
4202
4127
|
* @ignore
|
4203
4128
|
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
4204
4129
|
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
4130
|
+
* @param {number=} topPx Top position of bound
|
4205
4131
|
*/
|
4206
|
-
ILayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {};
|
4132
|
+
ILayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {};
|
4207
4133
|
|
4208
4134
|
/* harmony default export */ const grid_ILayoutGrid = (ILayoutGrid);
|
4209
4135
|
|
@@ -5082,7 +5008,7 @@ StretchedCells.prototype.getRowIndex = function (cellRef) {
|
|
5082
5008
|
* @return {Cell}
|
5083
5009
|
*/
|
5084
5010
|
StretchedCells.prototype.stretchCell = function (rowIndex, colIndex) {
|
5085
|
-
// Increase the active count regardless of redundancy. This acts as a dirty flag. It does not
|
5011
|
+
// Increase the active count regardless of redundancy. This acts as a dirty flag. It does not need to be accurate
|
5086
5012
|
++this._activeCount;
|
5087
5013
|
if(!colIndex || colIndex < 0) {
|
5088
5014
|
colIndex = 0;
|
@@ -5097,7 +5023,17 @@ StretchedCells.prototype.stretchCell = function (rowIndex, colIndex) {
|
|
5097
5023
|
}
|
5098
5024
|
var cellElem = cell["getElement"]();
|
5099
5025
|
cellElem["stretched"] = true;
|
5100
|
-
cellElem._colIndex
|
5026
|
+
if(cellElem._colIndex !== colIndex) {
|
5027
|
+
cellElem._colIndex = colIndex;
|
5028
|
+
if(colIndex > 0) {
|
5029
|
+
cellElem.classList.add("right-stretching");
|
5030
|
+
} else {
|
5031
|
+
cellElem.classList.remove("right-stretching");
|
5032
|
+
}
|
5033
|
+
}
|
5034
|
+
if(cellElem._rowIndex !== rowIndex) {
|
5035
|
+
cellElem._rowIndex = rowIndex;
|
5036
|
+
}
|
5101
5037
|
|
5102
5038
|
var width = this._stretchSize || this._trackX.getTrackSize();
|
5103
5039
|
_updateXAxis(cell, this._trackX, colIndex, width);
|
@@ -8323,10 +8259,8 @@ LayoutGrid.prototype._updateColumnLayout = function () {
|
|
8323
8259
|
/** @public
|
8324
8260
|
* @ignore
|
8325
8261
|
* @param {boolean} enabled
|
8326
|
-
* @param {number=} fromR
|
8327
|
-
* @param {number=} toR
|
8328
8262
|
*/
|
8329
|
-
LayoutGrid.prototype._startBindingSession = function (enabled
|
8263
|
+
LayoutGrid.prototype._startBindingSession = function (enabled) {
|
8330
8264
|
// Prevent error when calling _startBindingSession in LayoutGrid
|
8331
8265
|
};
|
8332
8266
|
/** @public
|
@@ -9543,8 +9477,14 @@ LayoutGrid.prototype.moveColumn = function (from, to) {
|
|
9543
9477
|
|
9544
9478
|
util.moveArrayItem(this._columns, from, to);
|
9545
9479
|
|
9546
|
-
|
9547
|
-
|
9480
|
+
if(movedColumn.getElement().offsetParent) {
|
9481
|
+
var siblingIndex = to + 1;
|
9482
|
+
var nextSibling = this._columns[siblingIndex] || null;
|
9483
|
+
while (nextSibling && !nextSibling.getElement().offsetParent) {
|
9484
|
+
nextSibling = this._columns[++siblingIndex];
|
9485
|
+
}
|
9486
|
+
movedColumn.insertBefore(nextSibling);
|
9487
|
+
}
|
9548
9488
|
|
9549
9489
|
this._updateColumnIndices();
|
9550
9490
|
this._updateCellSpans(cellSpans, true); // Restore all styling
|
@@ -9763,6 +9703,10 @@ LayoutGrid.prototype.updateStretchedCells = function () {
|
|
9763
9703
|
* @return {number}
|
9764
9704
|
*/
|
9765
9705
|
LayoutGrid.prototype._calculateViewSize = function (forceRecal) {
|
9706
|
+
if(this._frozenLayout) {
|
9707
|
+
return this._stretchedCells.getStretchSize();
|
9708
|
+
}
|
9709
|
+
|
9766
9710
|
var ctx = this._ctx;
|
9767
9711
|
var stretchSize = forceRecal ? 0 : this._stretchedCells.getStretchSize();
|
9768
9712
|
if(!stretchSize && ctx) {
|
@@ -9770,9 +9714,6 @@ LayoutGrid.prototype._calculateViewSize = function (forceRecal) {
|
|
9770
9714
|
var contentWidth = this.getContentWidth();
|
9771
9715
|
stretchSize = ctx["getWidth"]();
|
9772
9716
|
if(stretchSize) { // Grid may not be in the document
|
9773
|
-
if(!ctx.hasClass("no-borders")) {
|
9774
|
-
stretchSize -= 1;
|
9775
|
-
}
|
9776
9717
|
if(contentWidth < stretchSize) { // If view width is larger than actual content
|
9777
9718
|
stretchSize = contentWidth;
|
9778
9719
|
}
|
@@ -10120,8 +10061,9 @@ LayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositi
|
|
10120
10061
|
* @ignore
|
10121
10062
|
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
10122
10063
|
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
10064
|
+
* @param {number=} topPx Top position of bound
|
10123
10065
|
*/
|
10124
|
-
LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
|
10066
|
+
LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
|
10125
10067
|
var columnBound = this._columnBound;
|
10126
10068
|
if(!columnBound) {
|
10127
10069
|
return;
|
@@ -10138,7 +10080,9 @@ LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
|
|
10138
10080
|
columnBound.style.left = lftPx + "px";
|
10139
10081
|
columnBound.style.width = (rgtPx - lftPx) + "px";
|
10140
10082
|
|
10141
|
-
|
10083
|
+
topPx = topPx || 0;
|
10084
|
+
columnBound.style.top = topPx + "px";
|
10085
|
+
columnBound.style.height = (this._trackY.getTrackSize() - topPx) + "px";
|
10142
10086
|
columnBound.classList.toggle("no-left-bound", noBorders[0]);
|
10143
10087
|
columnBound.classList.toggle("no-right-bound", noBorders[1]);
|
10144
10088
|
if(this._boundLayer) {
|
@@ -12799,7 +12743,15 @@ DataTable.prototype.setRowData = function(rid, values, eventArg) { // Data chang
|
|
12799
12743
|
this._prevData[rid] = this._rows[rid]; // Move reference from the removed row to history
|
12800
12744
|
delete this._rows[rid];
|
12801
12745
|
if(this._segments) {
|
12802
|
-
|
12746
|
+
var segment = this._segments.getSegment(rid);
|
12747
|
+
if(segment) {
|
12748
|
+
if(this._segments.removeSegment(rid)) {
|
12749
|
+
segmentChanged = true;
|
12750
|
+
if(!this._segments.getSegmentCount()) {
|
12751
|
+
this._segments = null;
|
12752
|
+
}
|
12753
|
+
}
|
12754
|
+
}
|
12803
12755
|
}
|
12804
12756
|
for(var i = this._rids.length; --i >= 0;) {
|
12805
12757
|
if(this._rids[i] === rid) {
|
@@ -14002,18 +13954,33 @@ DataTable._performMultiLevelSorting = function(dataRows, sortingDefs, segmentVal
|
|
14002
13954
|
return null;
|
14003
13955
|
}
|
14004
13956
|
|
13957
|
+
var sortLogic;
|
14005
13958
|
// Populate data for each definition
|
14006
13959
|
for(var c = 0; c < defCount; ++c) {
|
14007
13960
|
var sortingDef = sortingDefs[c];
|
14008
|
-
var columnId = sortingDef[0];
|
14009
13961
|
var rows = sortingDef[1];
|
14010
|
-
|
14011
|
-
|
14012
|
-
|
14013
|
-
|
14014
|
-
|
14015
|
-
|
14016
|
-
|
13962
|
+
sortLogic = sortingDef[2];
|
13963
|
+
var rowSorting = sortLogic["rowSorting"];
|
13964
|
+
var r;
|
13965
|
+
if(rowSorting) {
|
13966
|
+
if(rows) {
|
13967
|
+
rows.length = rowCount;
|
13968
|
+
for(r = 0; r < rowCount; ++r) {
|
13969
|
+
rows[r] = dataRows[r];
|
13970
|
+
}
|
13971
|
+
} else {
|
13972
|
+
rows = sortingDef[1] = dataRows;
|
13973
|
+
}
|
13974
|
+
} else {
|
13975
|
+
if(rows) {
|
13976
|
+
rows.length = rowCount;
|
13977
|
+
} else {
|
13978
|
+
rows = sortingDef[1] = new Array(rowCount);
|
13979
|
+
}
|
13980
|
+
var columnId = sortingDef[0];
|
13981
|
+
for(r = 0; r < rowCount; ++r) {
|
13982
|
+
rows[r] = dataRows[r][columnId];
|
13983
|
+
}
|
14017
13984
|
}
|
14018
13985
|
}
|
14019
13986
|
|
@@ -14039,7 +14006,7 @@ DataTable._performMultiLevelSorting = function(dataRows, sortingDefs, segmentVal
|
|
14039
14006
|
}
|
14040
14007
|
|
14041
14008
|
var sortOrder = 0;
|
14042
|
-
var
|
14009
|
+
var sortContext;
|
14043
14010
|
if(defCount > 1) {
|
14044
14011
|
sortLogic = DataTable._multiColumnCompareLogic;
|
14045
14012
|
sortContext = sortingDefs;
|
@@ -16970,45 +16937,65 @@ DataView.prototype.isSorting = function() {
|
|
16970
16937
|
|
16971
16938
|
/** Hide rows in the data view
|
16972
16939
|
* @param {string|number} rId Row id to hide. If the rId is a number, it will be treated as a row index
|
16973
|
-
* @param {boolean=}
|
16940
|
+
* @param {boolean=} hidden=true If the value is false, the specified row will be shown.
|
16974
16941
|
* @public
|
16975
16942
|
*/
|
16976
|
-
DataView.prototype.hideRow = function(rId,
|
16977
|
-
this.
|
16943
|
+
DataView.prototype.hideRow = function(rId, hidden) {
|
16944
|
+
this.hideRows([rId], hidden);
|
16978
16945
|
};
|
16979
16946
|
/** Hide rows in the data view
|
16980
16947
|
* @param {Array.<string|number>} rowRefs Array of row ids or indices to hide
|
16981
|
-
* @param {boolean=}
|
16982
|
-
* @public
|
16983
|
-
*/
|
16984
|
-
DataView.prototype.hideRows = function(rowRefs, opt_show) {
|
16985
|
-
this.showRows(rowRefs, opt_show === false);
|
16986
|
-
};
|
16987
|
-
/**
|
16988
|
-
* Show/hide rows in the data view
|
16989
|
-
* @param {Array.<string|number>} rowRefs Array of row ids or indices to hide
|
16990
|
-
* @param {boolean=} opt_show hide instead show if false
|
16948
|
+
* @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
|
16991
16949
|
* @public
|
16992
16950
|
*/
|
16993
|
-
DataView.prototype.
|
16994
|
-
|
16951
|
+
DataView.prototype.hideRows = function(rowRefs, hidden) {
|
16952
|
+
hidden = hidden !== false;
|
16953
|
+
var dirty = false;
|
16954
|
+
var rids = this._toRowIds(rowRefs);
|
16955
|
+
var hiddenRids = this._hiddenRids;
|
16956
|
+
|
16995
16957
|
if(hidden){
|
16996
|
-
if(!
|
16997
|
-
this._hiddenRids = {};
|
16958
|
+
if(!hiddenRids) {
|
16959
|
+
hiddenRids = this._hiddenRids = {};
|
16998
16960
|
}
|
16999
|
-
} else if(!
|
16961
|
+
} else if(!hiddenRids) {
|
17000
16962
|
return; // All rows are visible
|
17001
16963
|
}
|
17002
16964
|
|
17003
|
-
var rids = this._toRowIds(rowRefs);
|
17004
16965
|
for(var i = rids.length; --i >= 0;) {
|
17005
16966
|
var rid = rids[i];
|
17006
16967
|
if(rid) { // undefined, null, and an empty string value are not a valid row id
|
17007
|
-
|
16968
|
+
if(!!hiddenRids[rid] !== hidden) {
|
16969
|
+
hiddenRids[rid] = hidden;
|
16970
|
+
dirty = true;
|
16971
|
+
}
|
17008
16972
|
}
|
17009
16973
|
}
|
17010
16974
|
|
17011
|
-
|
16975
|
+
if(dirty) {
|
16976
|
+
if(!hidden) {
|
16977
|
+
var hasHiddenRow = false;
|
16978
|
+
for(var key in hiddenRids) {
|
16979
|
+
if(hiddenRids[key]) {
|
16980
|
+
hasHiddenRow = true;
|
16981
|
+
break;
|
16982
|
+
}
|
16983
|
+
}
|
16984
|
+
if(!hasHiddenRow) {
|
16985
|
+
hiddenRids = this._hiddenRids = null;
|
16986
|
+
}
|
16987
|
+
}
|
16988
|
+
this._refreshAndNotify(); // Very slow
|
16989
|
+
}
|
16990
|
+
};
|
16991
|
+
/**
|
16992
|
+
* Show/hide rows in the data view
|
16993
|
+
* @param {Array.<string|number>} rowRefs Array of row ids or indices to hide
|
16994
|
+
* @param {boolean=} shown=true If the value is false, the specified rows will be hidden.
|
16995
|
+
* @public
|
16996
|
+
*/
|
16997
|
+
DataView.prototype.showRows = function(rowRefs, shown) {
|
16998
|
+
this.hideRows(rowRefs, shown === false);
|
17012
16999
|
};
|
17013
17000
|
/** Unhide all rows
|
17014
17001
|
* @public
|
@@ -17024,7 +17011,7 @@ DataView.prototype.unhideAllRows = function(){
|
|
17024
17011
|
* @return {boolean}
|
17025
17012
|
*/
|
17026
17013
|
DataView.prototype.hasHiddenRow = function(){
|
17027
|
-
return
|
17014
|
+
return this._hiddenRids ? true : false;
|
17028
17015
|
};
|
17029
17016
|
|
17030
17017
|
/** @public
|
@@ -22163,12 +22150,22 @@ VirtualizedLayoutGrid.prototype.updateLayout = function () {
|
|
22163
22150
|
/** {@link ILayoutGrid#stretchCell}
|
22164
22151
|
* @inheritDoc */
|
22165
22152
|
VirtualizedLayoutGrid.prototype.stretchCell = function (cellRef, rowIndex, opt_stretching, onlyToTheRight) {
|
22166
|
-
|
22153
|
+
var stretchedCell = this._grid.stretchCell(
|
22167
22154
|
cellRef,
|
22168
22155
|
(rowIndex != null) ? rowIndex - this._firstIndex : null,
|
22169
22156
|
opt_stretching,
|
22170
22157
|
onlyToTheRight
|
22171
22158
|
);
|
22159
|
+
|
22160
|
+
if (stretchedCell){
|
22161
|
+
var cellElem = stretchedCell.getElement();
|
22162
|
+
if(rowIndex === 0) {
|
22163
|
+
cellElem.classList.add("top");
|
22164
|
+
} else {
|
22165
|
+
cellElem.classList.remove("top");
|
22166
|
+
}
|
22167
|
+
}
|
22168
|
+
return stretchedCell;
|
22172
22169
|
};
|
22173
22170
|
|
22174
22171
|
/** {@link ILayoutGrid#unstretchCell}
|
@@ -22387,9 +22384,10 @@ VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
|
|
22387
22384
|
* @ignore
|
22388
22385
|
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
22389
22386
|
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
22387
|
+
* @param {number=} topPx Top position of bound
|
22390
22388
|
*/
|
22391
|
-
VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
|
22392
|
-
this._grid.updateColumnBounds(positions, noBorders);
|
22389
|
+
VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
|
22390
|
+
this._grid.updateColumnBounds(positions, noBorders, topPx);
|
22393
22391
|
this._updateRowBounds();
|
22394
22392
|
};
|
22395
22393
|
/** @private
|
@@ -22579,10 +22577,9 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
|
|
22579
22577
|
|
22580
22578
|
|
22581
22579
|
;// CONCATENATED MODULE: ./src/js/grid/Core.js
|
22582
|
-
/* eslint-disable */
|
22583
|
-
|
22584
22580
|
|
22585
22581
|
|
22582
|
+
// eslint-disable-line
|
22586
22583
|
|
22587
22584
|
|
22588
22585
|
|
@@ -22594,7 +22591,6 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
|
|
22594
22591
|
|
22595
22592
|
|
22596
22593
|
|
22597
|
-
/* eslint-enable */
|
22598
22594
|
|
22599
22595
|
//#region Events
|
22600
22596
|
/** @event Core#sectionAdded */
|
@@ -22632,6 +22628,15 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
|
|
22632
22628
|
*/
|
22633
22629
|
//#endregion Events
|
22634
22630
|
|
22631
|
+
/** @private
|
22632
|
+
* @param {number} a
|
22633
|
+
* @param {number} b
|
22634
|
+
* @return {number}
|
22635
|
+
*/
|
22636
|
+
var ascNumberSorter = function (a, b) {
|
22637
|
+
return a - b;
|
22638
|
+
};
|
22639
|
+
|
22635
22640
|
/** @constructor
|
22636
22641
|
* @param {Element=} opt_initializer this can be either element id (string) or DOM element.
|
22637
22642
|
* @extends {ElementWrapper}
|
@@ -22769,7 +22774,8 @@ var Core_Core = function (opt_initializer) {
|
|
22769
22774
|
"rowAdded",
|
22770
22775
|
"rowRemoved",
|
22771
22776
|
"columnPositionChanged",
|
22772
|
-
"rowPositionChanged"
|
22777
|
+
"rowPositionChanged",
|
22778
|
+
"beforeColumnBoundUpdate"
|
22773
22779
|
);
|
22774
22780
|
|
22775
22781
|
// For debugging in advanced optimization mode
|
@@ -22789,13 +22795,13 @@ var Core_Core = function (opt_initializer) {
|
|
22789
22795
|
Core_Core._runningGridId++;
|
22790
22796
|
|
22791
22797
|
// init hiddenInput for retrieve copy and cut event
|
22792
|
-
var hiddenInput = document.createElement(
|
22793
|
-
hiddenInput.style.position =
|
22794
|
-
hiddenInput.style.width =
|
22795
|
-
hiddenInput.style.height =
|
22796
|
-
hiddenInput.style.padding =
|
22797
|
-
hiddenInput.style.border =
|
22798
|
-
hiddenInput.value =
|
22798
|
+
var hiddenInput = document.createElement("input");
|
22799
|
+
hiddenInput.style.position = "absolute";
|
22800
|
+
hiddenInput.style.width = "0";
|
22801
|
+
hiddenInput.style.height = "0";
|
22802
|
+
hiddenInput.style.padding = "0";
|
22803
|
+
hiddenInput.style.border = "0";
|
22804
|
+
hiddenInput.value = "0";
|
22799
22805
|
_t._hiddenInput = hiddenInput;
|
22800
22806
|
elem.insertBefore(hiddenInput, elem.firstChild);
|
22801
22807
|
|
@@ -23101,7 +23107,7 @@ Core_Core.prototype._rowHeightTimerId = 0;
|
|
23101
23107
|
* @return {string}
|
23102
23108
|
*/
|
23103
23109
|
Core_Core.getVersion = function () {
|
23104
|
-
return "5.
|
23110
|
+
return "5.1.17";
|
23105
23111
|
};
|
23106
23112
|
/** {@link ElementWrapper#dispose}
|
23107
23113
|
* @override
|
@@ -23265,6 +23271,9 @@ Core_Core.prototype.getConfigObject = function (gridOptions) {
|
|
23265
23271
|
if(this.hasClass("no-horizontal-grid-line")) {
|
23266
23272
|
obj["horizontalLines"] = false;
|
23267
23273
|
}
|
23274
|
+
if(this.hasClass("no-content-vertical-line")) {
|
23275
|
+
obj["contentVerticalLines"] = false;
|
23276
|
+
}
|
23268
23277
|
if(this._bottomPaddingSect) {
|
23269
23278
|
obj["contentBottomPadding"] = this._bottomPadding;
|
23270
23279
|
}
|
@@ -24098,13 +24107,118 @@ Core_Core.prototype.isColumnMoveAllowed = function (fromColIndex, toColIndex) {
|
|
24098
24107
|
return true;
|
24099
24108
|
};
|
24100
24109
|
|
24110
|
+
/** This method is used for checking movability of column.
|
24111
|
+
* @public
|
24112
|
+
* @param {number} colIndex Index of the column.
|
24113
|
+
* @return {boolean} Return true if the column moving is movable, and false otherwise
|
24114
|
+
*/
|
24115
|
+
Core_Core.prototype.isColumnMovable = function (colIndex) {
|
24116
|
+
var stationaryIndex = this.getStationaryColumnIndex();
|
24117
|
+
|
24118
|
+
if (stationaryIndex > -1) {
|
24119
|
+
if (colIndex <= stationaryIndex) {
|
24120
|
+
return false;
|
24121
|
+
}
|
24122
|
+
}
|
24123
|
+
|
24124
|
+
return true;
|
24125
|
+
};
|
24126
|
+
|
24101
24127
|
/** @public
|
24102
|
-
* @param {number} fromCol INCLUSIVE
|
24128
|
+
* @param {number|Array.<number>} fromCol INCLUSIVE index/indices of the column to be moved
|
24103
24129
|
* @param {number} destCol INCLUSIVE
|
24104
24130
|
* @return {boolean} Return true if there is any change, and false otherwise
|
24105
24131
|
* @fires Core#columnMoved
|
24106
24132
|
*/
|
24107
24133
|
Core_Core.prototype.moveColumn = function (fromCol, destCol) {
|
24134
|
+
if(typeof fromCol === "number") {
|
24135
|
+
return this._moveColumn(fromCol, destCol);
|
24136
|
+
}
|
24137
|
+
if(!Array.isArray(fromCol)) {
|
24138
|
+
return false;
|
24139
|
+
}
|
24140
|
+
|
24141
|
+
// Validate user inputs
|
24142
|
+
var i;
|
24143
|
+
var len = fromCol.length;
|
24144
|
+
var colIndices = [];
|
24145
|
+
var colIndex = 0;
|
24146
|
+
var colCount = this.getColumnCount();
|
24147
|
+
var dict = {};
|
24148
|
+
for(i = 0; i < len; ++i) {
|
24149
|
+
colIndex = fromCol[i];
|
24150
|
+
if(colIndex >= 0 && colIndex < colCount) { // Filter out invalid index
|
24151
|
+
if(dict[colIndex] == null) { // Remove duplication
|
24152
|
+
dict[colIndex] = 1;
|
24153
|
+
colIndices.push(colIndex);
|
24154
|
+
}
|
24155
|
+
}
|
24156
|
+
}
|
24157
|
+
if (destCol < 0) {
|
24158
|
+
destCol = 0;
|
24159
|
+
} else if (destCol >= colCount) {
|
24160
|
+
destCol = colCount - 1;
|
24161
|
+
}
|
24162
|
+
|
24163
|
+
// Skip unneccessary cases
|
24164
|
+
len = colIndices.length;
|
24165
|
+
if(!len) {
|
24166
|
+
return false;
|
24167
|
+
}
|
24168
|
+
if(len === 1) {
|
24169
|
+
return this._moveColumn(colIndices[0], destCol);
|
24170
|
+
}
|
24171
|
+
if(!this.isColumnMoveAllowed(colIndices, destCol)) {
|
24172
|
+
return false;
|
24173
|
+
}
|
24174
|
+
|
24175
|
+
colIndices.sort(ascNumberSorter);
|
24176
|
+
if(dict[destCol]) { // Destination falls in the same place as source columns
|
24177
|
+
// Check if source columns are in continuous sequence
|
24178
|
+
var continuousSequence = true;
|
24179
|
+
colIndex = colIndices[0];
|
24180
|
+
for(i = 1; i < len; ++i) {
|
24181
|
+
if(++colIndex !== colIndices[i]) {
|
24182
|
+
continuousSequence = false;
|
24183
|
+
break;
|
24184
|
+
}
|
24185
|
+
}
|
24186
|
+
if(continuousSequence) {
|
24187
|
+
return false; // No moving operation is required
|
24188
|
+
}
|
24189
|
+
}
|
24190
|
+
var prevState = this.freezeLayout(true);
|
24191
|
+
|
24192
|
+
// Start moving multiple items
|
24193
|
+
var rhsCount = 0;
|
24194
|
+
var srcIndex, destIndex;
|
24195
|
+
// Perform move operation on the right hand side
|
24196
|
+
for(i = 0; i < len; ++i) {
|
24197
|
+
srcIndex = colIndices[i];
|
24198
|
+
if(srcIndex >= destCol) {
|
24199
|
+
destIndex = destCol + rhsCount;
|
24200
|
+
this._moveColumn(srcIndex, destIndex);
|
24201
|
+
++rhsCount;
|
24202
|
+
}
|
24203
|
+
}
|
24204
|
+
// Perform move operation on the left hand side
|
24205
|
+
var lhsCount = len - rhsCount;
|
24206
|
+
destIndex = rhsCount ? destCol - 1 : destCol;
|
24207
|
+
for(i = 0; i < lhsCount; ++i) {
|
24208
|
+
srcIndex = colIndices[i] - i;
|
24209
|
+
this._moveColumn(srcIndex, destIndex);
|
24210
|
+
}
|
24211
|
+
|
24212
|
+
this.freezeLayout(prevState);
|
24213
|
+
return true;
|
24214
|
+
};
|
24215
|
+
/** @private
|
24216
|
+
* @param {number} fromCol INCLUSIVE
|
24217
|
+
* @param {number} destCol INCLUSIVE
|
24218
|
+
* @return {boolean} Return true if there is any change, and false otherwise
|
24219
|
+
* @fires Core#columnMoved
|
24220
|
+
*/
|
24221
|
+
Core_Core.prototype._moveColumn = function (fromCol, destCol) {
|
24108
24222
|
var colCount = this.getColumnCount();
|
24109
24223
|
if (fromCol < 0) { fromCol = 0; }
|
24110
24224
|
else if (fromCol >= colCount) { fromCol = colCount - 1; }
|
@@ -24189,6 +24303,7 @@ Core_Core.prototype.moveColumn = function (fromCol, destCol) {
|
|
24189
24303
|
this._colVirtualizer.update();
|
24190
24304
|
}
|
24191
24305
|
}
|
24306
|
+
this._updateColumnBounds();
|
24192
24307
|
return true;
|
24193
24308
|
};
|
24194
24309
|
|
@@ -25395,6 +25510,7 @@ Core_Core.prototype.isLayoutFrozen = function () {
|
|
25395
25510
|
|
25396
25511
|
/** Deprecated
|
25397
25512
|
* @public
|
25513
|
+
* @ignore
|
25398
25514
|
* @function
|
25399
25515
|
* @param {boolean=} opt_shown
|
25400
25516
|
* @see {@link Core#toggleBorders}
|
@@ -25402,6 +25518,7 @@ Core_Core.prototype.isLayoutFrozen = function () {
|
|
25402
25518
|
Core_Core.prototype.showBorders = util._deprecatedFunction;
|
25403
25519
|
/** Deprecated
|
25404
25520
|
* @public
|
25521
|
+
* @ignore
|
25405
25522
|
* @function
|
25406
25523
|
* @param {boolean=} opt_hidden
|
25407
25524
|
* @see {@link Core#toggleBorders}
|
@@ -25435,6 +25552,14 @@ Core_Core.prototype.toggleVerticalLines = function(forcedVal) {
|
|
25435
25552
|
Core_Core.prototype.toggleHorizontalLines = function(forcedVal) {
|
25436
25553
|
this.toggleClass("no-horizontal-grid-line", forcedVal != null ? !forcedVal : null);
|
25437
25554
|
};
|
25555
|
+
/** Toggle vertical gridlines. This applies to ONLY content sections.
|
25556
|
+
* @public
|
25557
|
+
* @param {boolean=} forcedVal If value is true, show horizontal lines, otherwise hide them
|
25558
|
+
*/
|
25559
|
+
Core_Core.prototype.toggleContentVerticalLines = function(forcedVal) {
|
25560
|
+
this.toggleClass("no-content-vertical-line", forcedVal != null ? !forcedVal : null);
|
25561
|
+
};
|
25562
|
+
|
25438
25563
|
|
25439
25564
|
/** @public
|
25440
25565
|
* @return {Array.<string>}
|
@@ -26250,18 +26375,18 @@ Core_Core.prototype.isBinding = function() {
|
|
26250
26375
|
};
|
26251
26376
|
|
26252
26377
|
/**
|
26253
|
-
* Hide
|
26378
|
+
* Hide the specified rows by row id
|
26254
26379
|
* @param {number | string} rowId rowId of the row to hide
|
26255
|
-
* @param {boolean=} hidden
|
26380
|
+
* @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
|
26256
26381
|
* @public
|
26257
26382
|
*/
|
26258
26383
|
Core_Core.prototype.hideRow = function (rowId, hidden) {
|
26259
26384
|
this._dataSource.hideRow(rowId, hidden);
|
26260
26385
|
};
|
26261
26386
|
/**
|
26262
|
-
* Hide
|
26387
|
+
* Hide the specified rows by rowIds
|
26263
26388
|
* @param {number | string | Array.<number | string>} rowIds rowId(s) of the rows to hide
|
26264
|
-
* @param {boolean=} hidden
|
26389
|
+
* @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
|
26265
26390
|
* @public
|
26266
26391
|
*/
|
26267
26392
|
Core_Core.prototype.hideRows = function (rowIds, hidden) {
|
@@ -26273,9 +26398,9 @@ Core_Core.prototype.hideRows = function (rowIds, hidden) {
|
|
26273
26398
|
};
|
26274
26399
|
|
26275
26400
|
/**
|
26276
|
-
* Show
|
26401
|
+
* Show the specified rows by rowIds. To show all rows, use unhideAllRows method for better performance.
|
26277
26402
|
* @param {number | string | Array.<number | string>} rowIds rowId(s) of the rows to show
|
26278
|
-
* @param {boolean=} shown
|
26403
|
+
* @param {boolean=} shown=true If the value is false, the specified rows will be hidden.
|
26279
26404
|
* @public
|
26280
26405
|
*/
|
26281
26406
|
Core_Core.prototype.showRows = function (rowIds, shown) {
|
@@ -26296,7 +26421,7 @@ Core_Core.prototype.unhideAllRows = function () {
|
|
26296
26421
|
|
26297
26422
|
/**
|
26298
26423
|
* @public
|
26299
|
-
* @
|
26424
|
+
* @return {boolean}
|
26300
26425
|
*/
|
26301
26426
|
Core_Core.prototype.hasHiddenRow = function () {
|
26302
26427
|
return this._dataSource.hasHiddenRow();
|
@@ -26375,10 +26500,22 @@ Core_Core.prototype._updateColumnBounds = function () {
|
|
26375
26500
|
return;
|
26376
26501
|
}
|
26377
26502
|
|
26503
|
+
var colCount = this.getColumnCount();
|
26504
|
+
var colIndices = [];
|
26505
|
+
var i;
|
26506
|
+
for(i = 0; i < colCount; i++) {
|
26507
|
+
if(this.isSelectedColumn(i)) {
|
26508
|
+
colIndices.push(i);
|
26509
|
+
}
|
26510
|
+
}
|
26511
|
+
var arg = {
|
26512
|
+
selectedColumns: colIndices
|
26513
|
+
};
|
26514
|
+
this._dispatch("beforeColumnBoundUpdate", arg);
|
26515
|
+
|
26378
26516
|
var len = this.getColumnCount();
|
26379
26517
|
var lftIdx = -1;
|
26380
26518
|
var rgtIdx = -1;
|
26381
|
-
var i;
|
26382
26519
|
for(i = 0; i < len; ++i) {
|
26383
26520
|
if(this.isSelectedColumn(i)) {
|
26384
26521
|
rgtIdx = i;
|
@@ -26389,12 +26526,17 @@ Core_Core.prototype._updateColumnBounds = function () {
|
|
26389
26526
|
}
|
26390
26527
|
var sectCount = this._settings.length;
|
26391
26528
|
if(sectCount) {
|
26392
|
-
var
|
26529
|
+
var sectionSetting = this._settings[0];
|
26530
|
+
var section = sectionSetting.getSection();
|
26393
26531
|
var positions = [0, 0];
|
26394
26532
|
var noBorders = [false, false];
|
26395
26533
|
section.calculateColumnBounds(lftIdx, rgtIdx, positions, noBorders);
|
26396
|
-
|
26397
|
-
|
26534
|
+
var topPx = 0;
|
26535
|
+
if(sectionSetting.getType() === "title" && arg.topBoundRowIndex != null) {
|
26536
|
+
topPx = this._layoutY.getLaneStart(arg.topBoundRowIndex);
|
26537
|
+
}
|
26538
|
+
section.updateColumnBounds(positions, noBorders, topPx);
|
26539
|
+
for(i = 1; i < sectCount; i++) {
|
26398
26540
|
section = this._settings[i].getSection();
|
26399
26541
|
section.updateColumnBounds(positions, noBorders);
|
26400
26542
|
}
|
@@ -27564,6 +27706,10 @@ Core_Core.prototype._updateScrollbarHeight = function (paneChanged, contentChang
|
|
27564
27706
|
* @param {boolean} contentChanged
|
27565
27707
|
*/
|
27566
27708
|
Core_Core.prototype._updateScrollbarWidth = function (paneChanged, contentChanged) {
|
27709
|
+
if (this._frozenLayout) {
|
27710
|
+
return;
|
27711
|
+
}
|
27712
|
+
|
27567
27713
|
if (paneChanged && this._hScrollbarEnabled) {
|
27568
27714
|
// Scroll Frame
|
27569
27715
|
var gridElem = this.getElement();
|
@@ -27768,7 +27914,7 @@ Core_Core.prototype._updateLayout = function () {
|
|
27768
27914
|
this._syncLayoutToColumns(); // Update only if need
|
27769
27915
|
|
27770
27916
|
this._updateScrollbarHeight(true, true);
|
27771
|
-
this._updateScrollbarWidth(true, true);
|
27917
|
+
this._updateScrollbarWidth(true, true); // WARNING this may be redundant with _syncLayoutToColumns
|
27772
27918
|
|
27773
27919
|
var sectionCount = this.getSectionCount();
|
27774
27920
|
for (var s = 0; s < sectionCount; ++s) {
|
@@ -27900,7 +28046,7 @@ SortableTitlePlugin.ColumnOptions;
|
|
27900
28046
|
* @property {(boolean|number)=} multiColumn=false Alias to `multicolumn`
|
27901
28047
|
* @property {boolean=} threeStatesSorting=false If enabled, sorting will cycle through ascending, descending and original order states. This option is deprecated in favor of sortingSequence option
|
27902
28048
|
* @property {Object.<string, DataTable.SortLogic>=} sortLogic=null Custom logic for sorting based on the specified field. The key is field name and the value pair is a function.
|
27903
|
-
* @property {boolean=} disableDoubleClickToSort=
|
28049
|
+
* @property {boolean=} disableDoubleClickToSort=true If disabled, double click will trigger sorting operation
|
27904
28050
|
* @property {boolean=} sortableColumns=false If enabled, all columns will be sortable by field automatically
|
27905
28051
|
* @property {boolean=} sortableIndicator=false If enabled, sort indicator (diamond) icon will always show regardless of sorting states. In Halo theme, this option will be enabled by default.
|
27906
28052
|
* @property {boolean=} indicatorOnly=false If enabled, data will not be sorted, but the UI is rendered normally. This is useful for server side sorting.
|
@@ -27910,7 +28056,8 @@ SortableTitlePlugin.ColumnOptions;
|
|
27910
28056
|
* @property {Function=} preClicked A shortcut to define the preClicked event handler
|
27911
28057
|
* @property {Function=} clicked A shortcut to define the clicked event handler
|
27912
28058
|
* @property {Function=} preDataSorting A shortcut to define the preDataSorting event handler
|
27913
|
-
* @property {Array.<SortableTitlePlugin~SortOrder>=} sortingSequence=["a", "d"] Sequence in which sort order will be changed. The default value is ["a", "d"]. This option
|
28059
|
+
* @property {Array.<SortableTitlePlugin~SortOrder>=} sortingSequence=["a", "d"] Sequence in which sort order will be changed. The default value is ["a", "d"]. This option overrides threeStatesSorting
|
28060
|
+
* @property {boolean=} rowSorting=false A flag indicating that the given sortLogic takes entire row data instead of a field value for comparison
|
27914
28061
|
*/
|
27915
28062
|
SortableTitlePlugin.Options;
|
27916
28063
|
|
@@ -27939,7 +28086,7 @@ SortableTitlePlugin.prototype._dataSorting = true;
|
|
27939
28086
|
/** @private
|
27940
28087
|
* @type {boolean}
|
27941
28088
|
*/
|
27942
|
-
SortableTitlePlugin.prototype.
|
28089
|
+
SortableTitlePlugin.prototype._dblClickAllowed = false;
|
27943
28090
|
|
27944
28091
|
/** @private
|
27945
28092
|
* @type {number}
|
@@ -28082,19 +28229,20 @@ SortableTitlePlugin.prototype.unload = function (host) {
|
|
28082
28229
|
SortableTitlePlugin.prototype.afterInit = function () {
|
28083
28230
|
var t = this;
|
28084
28231
|
|
28085
|
-
//
|
28232
|
+
// Set logic to the data source, since the data source not available during the initialization
|
28086
28233
|
t.setSortLogics(t._sortLogic);
|
28087
28234
|
|
28088
|
-
|
28089
|
-
if (
|
28090
|
-
|
28091
|
-
|
28092
|
-
|
28093
|
-
|
28094
|
-
|
28095
|
-
|
28235
|
+
var userInput = t._initialSort;
|
28236
|
+
if (userInput != null) {
|
28237
|
+
if(Array.isArray(userInput)) {
|
28238
|
+
if(t._maxCount === 1) { // TODO: max count could be part of sortColumns method
|
28239
|
+
t.sortColumns(userInput.slice(0, 1));
|
28240
|
+
} else {
|
28241
|
+
t.sortColumns(userInput);
|
28242
|
+
}
|
28243
|
+
} else {
|
28244
|
+
t.sortColumns([userInput]);
|
28096
28245
|
}
|
28097
|
-
t.sortColumns(initialSort);
|
28098
28246
|
}
|
28099
28247
|
};
|
28100
28248
|
|
@@ -28272,7 +28420,9 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
|
|
28272
28420
|
if(this._maxCount !== 1) {
|
28273
28421
|
extOptions["multiColumn"] = this._maxCount === -1 ? true : this._maxCount;
|
28274
28422
|
}
|
28275
|
-
|
28423
|
+
if(this._dblClickAllowed) {
|
28424
|
+
extOptions["disableDoubleClickToSort"] = !this._dblClickAllowed;
|
28425
|
+
}
|
28276
28426
|
extOptions["sortableColumns"] = this._sortableColumns;
|
28277
28427
|
extOptions["indicatorOnly"] = !this._dataSorting;
|
28278
28428
|
// extOptions["mode"] = this._mode;
|
@@ -28645,9 +28795,10 @@ SortableTitlePlugin.prototype.getColumnSortingField = function (colIndex) {
|
|
28645
28795
|
* @public
|
28646
28796
|
* @param {number} colIndex
|
28647
28797
|
* @param {string|null} field A field used for sorting
|
28648
|
-
* @param {Function=} sortLogic
|
28798
|
+
* @param {Function=} sortLogic=null
|
28799
|
+
* @param {boolean=} rowSorting=false A flag indicating that the given sortLogic takes entire row data instead of a field value for comparison
|
28649
28800
|
*/
|
28650
|
-
SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field, sortLogic) {
|
28801
|
+
SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field, sortLogic, rowSorting) {
|
28651
28802
|
if (typeof colIndex == "number" && field != null) {
|
28652
28803
|
var options = this._newSortOptions(colIndex);
|
28653
28804
|
if (!field) {
|
@@ -28659,6 +28810,9 @@ SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field,
|
|
28659
28810
|
if(sortLogic != null && !this._userManagedLogic) {
|
28660
28811
|
if (options["sortLogic"] !== sortLogic) {
|
28661
28812
|
options["sortLogic"] = sortLogic || null;
|
28813
|
+
if(rowSorting && sortLogic) {
|
28814
|
+
sortLogic["rowSorting"] = true; // Tell data view/table about the argument
|
28815
|
+
}
|
28662
28816
|
}
|
28663
28817
|
}
|
28664
28818
|
}
|
@@ -28758,10 +28912,10 @@ SortableTitlePlugin.prototype.disableDataSorting = function (disabled) {
|
|
28758
28912
|
};
|
28759
28913
|
/** @public
|
28760
28914
|
* @description To allow double click action to sort. Default value is false.
|
28761
|
-
* @param {boolean=} disabled
|
28915
|
+
* @param {boolean=} disabled=false
|
28762
28916
|
*/
|
28763
28917
|
SortableTitlePlugin.prototype.disableDoubleClickToSort = function (disabled) {
|
28764
|
-
this.
|
28918
|
+
this._dblClickAllowed = !disabled;
|
28765
28919
|
};
|
28766
28920
|
/** This api is deprecated. Use {@link SortableTitlePlugin.prototype.disableColumnSorting} instead
|
28767
28921
|
* @public
|
@@ -28807,54 +28961,26 @@ SortableTitlePlugin.prototype.setClickDelayInterval = function (opt_ms) {
|
|
28807
28961
|
this._delayInterval = (opt_ms != null) ? opt_ms : 500;
|
28808
28962
|
};
|
28809
28963
|
|
28810
|
-
/** @private
|
28811
|
-
* @description Pre-process columns options to support both composite and rt-grid backward compatible
|
28812
|
-
* @param {number} colIndex
|
28813
|
-
* @param {Object} options
|
28814
|
-
* @returns {Object}
|
28815
|
-
*/
|
28816
|
-
SortableTitlePlugin.prototype._prepareColumnOptions = function (colIndex, options) {
|
28817
|
-
var t = this;
|
28818
|
-
var column = options || {};
|
28819
|
-
var colOption = {
|
28820
|
-
"colIndex": colIndex,
|
28821
|
-
"field": column["field"],
|
28822
|
-
"sortable": !!t._sortableColumns
|
28823
|
-
};
|
28824
|
-
|
28825
|
-
if (column["sortBy"] != null) { // composite grid option
|
28826
|
-
colOption["sortable"] = !!column["sortBy"];
|
28827
|
-
colOption["sortBy"] = column["sortBy"];
|
28828
|
-
}
|
28829
|
-
if (column["sortable"] != null) { // rt grid option
|
28830
|
-
colOption["sortable"] = !!column["sortable"];
|
28831
|
-
}
|
28832
|
-
|
28833
|
-
colOption["sortLogic"] = column["sortLogic"] || column["sortingLogic"] || column["sorter"]; // Originally, rt grid support option for sortLogic by column
|
28834
|
-
colOption["sort"] = column["defaultSort"] || column["sort"]; // composite and rt grid option for default sort order
|
28835
|
-
return colOption;
|
28836
|
-
};
|
28837
|
-
|
28838
28964
|
/** @private
|
28839
28965
|
* @description Get initial sort from column option `defaultSort` or `sort`
|
28840
28966
|
* @param {Object} options Core model object
|
28841
28967
|
* @returns {Object}
|
28842
28968
|
*/
|
28843
28969
|
SortableTitlePlugin.prototype._initialSortByColumnField = function (options) {
|
28844
|
-
var
|
28845
|
-
var
|
28846
|
-
var
|
28847
|
-
|
28848
|
-
var
|
28849
|
-
|
28850
|
-
|
28851
|
-
|
28852
|
-
"colIndex":
|
28853
|
-
"sortOrder":
|
28970
|
+
var columns = options["columns"];
|
28971
|
+
var colCount = columns ? columns.length : 0;
|
28972
|
+
for (var i = 0; i < colCount; i++) {
|
28973
|
+
var column = columns[i];
|
28974
|
+
var sortOrder = column["defaultSort"] || column["sort"]; // composite and rt grid option for default sort order
|
28975
|
+
if (sortOrder) {
|
28976
|
+
// TODO: Support multi-column sorting
|
28977
|
+
return {
|
28978
|
+
"colIndex": i,
|
28979
|
+
"sortOrder": sortOrder
|
28854
28980
|
};
|
28855
28981
|
}
|
28856
28982
|
}
|
28857
|
-
return
|
28983
|
+
return null;
|
28858
28984
|
};
|
28859
28985
|
|
28860
28986
|
/** @private
|
@@ -28965,7 +29091,7 @@ SortableTitlePlugin.prototype._onClickTitle = function (grid, e) {
|
|
28965
29091
|
if(this._disabled) {
|
28966
29092
|
return;
|
28967
29093
|
}
|
28968
|
-
if (e.detail === 2 && this.
|
29094
|
+
if (e.detail === 2 && !this._dblClickAllowed) { // dblclick
|
28969
29095
|
if (this._clickTimer) {
|
28970
29096
|
clearTimeout(this._clickTimer);
|
28971
29097
|
this._clickTimer = 0;
|
@@ -29243,18 +29369,35 @@ SortableTitlePlugin.prototype._sortColumn = function (states, opt_arg) {
|
|
29243
29369
|
SortableTitlePlugin.prototype._onColumnAdded = function (e) {
|
29244
29370
|
var t = this;
|
29245
29371
|
var colIndex = e["colIndex"];
|
29246
|
-
var
|
29247
|
-
|
29248
|
-
var
|
29249
|
-
var
|
29372
|
+
var column = e["context"] || {};
|
29373
|
+
|
29374
|
+
var sortable = !!t._sortableColumns;
|
29375
|
+
var field = column["field"];
|
29376
|
+
var sortBy = column["sortBy"];
|
29377
|
+
|
29378
|
+
if (sortBy != null) { // composite grid option
|
29379
|
+
sortable = !!sortBy;
|
29380
|
+
field = sortBy;
|
29381
|
+
}
|
29382
|
+
if (column["sortable"] != null) { // rt grid option
|
29383
|
+
sortable = !!column["sortable"];
|
29384
|
+
}
|
29385
|
+
|
29386
|
+
var sortLogic = column["sortLogic"] || column["sortingLogic"] || column["sorter"]; // Originally, rt grid support option for sortLogic by column
|
29387
|
+
if(!sortLogic) {
|
29388
|
+
sortLogic = t._sortLogic[field];
|
29389
|
+
}
|
29390
|
+
if(typeof sortLogic !== "function") {
|
29391
|
+
sortLogic = null;
|
29392
|
+
}
|
29250
29393
|
|
29251
|
-
var sortingSequence =
|
29394
|
+
var sortingSequence = column["sortingSequence"];
|
29252
29395
|
if (sortingSequence != null && field) { // Make sure that column config does not affect grid level config
|
29253
29396
|
t.setSortingSequence(sortingSequence, field);
|
29254
29397
|
}
|
29255
29398
|
|
29256
|
-
if (
|
29257
|
-
t.setColumnSortingField(colIndex, field,
|
29399
|
+
if (sortable) { // TODO: Check if empty field should be sortable
|
29400
|
+
t.setColumnSortingField(colIndex, field, sortLogic, column["rowSorting"]);
|
29258
29401
|
} else {
|
29259
29402
|
t.disableColumnSorting(colIndex, true);
|
29260
29403
|
}
|