@refinitiv-ui/efx-grid 6.0.0 → 6.0.3
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-format-dialog/lib/column-format-dialog.d.ts +13 -1
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +15 -2
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +226 -23
- package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/core/dist/core.css +1 -1
- package/lib/core/dist/core.js +10158 -7908
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataTable.js +32 -10
- package/lib/core/es6/data/DataView.d.ts +16 -7
- package/lib/core/es6/data/DataView.js +172 -49
- package/lib/core/es6/data/Segment.d.ts +2 -0
- package/lib/core/es6/data/Segment.js +7 -0
- package/lib/core/es6/data/WrappedView.d.ts +289 -0
- package/lib/core/es6/data/WrappedView.js +1319 -0
- package/lib/core/es6/grid/Core.d.ts +13 -0
- package/lib/core/es6/grid/Core.js +406 -160
- package/lib/core/es6/grid/ILayoutGrid.d.ts +8 -0
- package/lib/core/es6/grid/ILayoutGrid.js +45 -2
- package/lib/core/es6/grid/LayoutGrid.d.ts +10 -1
- package/lib/core/es6/grid/LayoutGrid.js +257 -82
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +10 -1
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +316 -24
- package/lib/core/es6/grid/components/Column.js +8 -2
- package/lib/core/es6/grid/components/HScrollbar.d.ts +4 -0
- package/lib/core/es6/grid/components/HScrollbar.js +20 -4
- package/lib/core/es6/grid/util/TrackLayout.d.ts +1 -1
- package/lib/core/es6/grid/util/TrackLayout.js +2 -3
- package/lib/core/es6/tr-grid-theme.js +1 -1
- package/lib/filter-dialog/lib/checkbox-list.d.ts +13 -1
- package/lib/filter-dialog/lib/filter-dialog.d.ts +13 -1
- package/lib/filter-dialog/lib/filter-dialog.js +24 -9
- package/lib/grid/lib/efx-grid.d.ts +27 -8
- package/lib/grid/lib/efx-grid.js +114 -115
- package/lib/grid/themes/base.less +5 -3
- 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 +69 -32
- 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/grid/themes/solar/charcoal/efx-grid.js +1 -1
- package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
- package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/index.d.ts +56 -56
- package/lib/index.js +56 -56
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +1 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +43 -12
- package/lib/rt-grid/dist/rt-grid.js +10293 -7865
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +4 -1
- package/lib/rt-grid/es6/ColumnDefinition.js +3 -0
- package/lib/rt-grid/es6/Grid.d.ts +14 -7
- package/lib/rt-grid/es6/Grid.js +244 -75
- package/lib/rt-grid/es6/RowDefinition.d.ts +4 -1
- package/lib/rt-grid/es6/RowDefinition.js +52 -2
- package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +1 -1
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +53 -40
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +4 -1
- package/lib/tr-grid-checkbox/es6/Checkbox.js +41 -14
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +1 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +10 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +5 -1
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +226 -4
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +3 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +6 -1
- package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +4 -2
- package/lib/tr-grid-filter-input/es6/FilterInput.js +73 -10
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +1 -1
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +13 -1
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +1 -3
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +165 -70
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +88 -33
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +41 -31
- package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +13 -9
- package/lib/tr-grid-row-selection/es6/RowSelection.js +220 -29
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +2 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +36 -0
- package/lib/tr-grid-util/es6/CellPainter.d.ts +8 -8
- package/lib/tr-grid-util/es6/Conflator.d.ts +2 -2
- package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
- package/lib/tr-grid-util/es6/DateTime.d.ts +4 -4
- package/lib/tr-grid-util/es6/Delay.d.ts +1 -1
- package/lib/tr-grid-util/es6/Dom.d.ts +4 -4
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +1 -1
- package/lib/tr-grid-util/es6/ElfDate.d.ts +3 -3
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -4
- package/lib/tr-grid-util/es6/EventDispatcher.d.ts +1 -1
- package/lib/tr-grid-util/es6/ExpanderIcon.js +2 -2
- package/lib/tr-grid-util/es6/FieldFormatter.d.ts +1 -1
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +5 -5
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +3 -3
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +1 -1
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +10 -2
- package/lib/tr-grid-util/es6/MultiTableManager.js +164 -57
- package/lib/tr-grid-util/es6/PercentBar.d.ts +1 -1
- package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
- package/lib/tr-grid-util/es6/Popup.d.ts +2 -2
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +1 -1
- package/lib/tr-grid-util/es6/RowPainter.d.ts +3 -0
- package/lib/tr-grid-util/es6/RowPainter.js +82 -20
- package/lib/tr-grid-util/es6/SubTable.d.ts +9 -9
- package/lib/tr-grid-util/es6/Table.d.ts +13 -13
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +3 -3
- package/lib/tr-grid-util/es6/TickCodes.d.ts +2 -2
- package/lib/tr-grid-util/es6/TouchProxy.d.ts +1 -1
- package/lib/tr-grid-util/es6/Util.d.ts +6 -6
- package/lib/tr-grid-util/es6/formula/Engine.d.ts +5 -5
- package/lib/tr-grid-util/es6/formula/Formula.d.ts +3 -3
- package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +2 -2
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +4 -4
- 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/MockQuotes.d.ts +11 -11
- package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +7 -7
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +1 -1
- package/lib/tr-grid-util/es6/jsx.d.ts +223 -0
- package/lib/types/es6/CellSelection.d.ts +1 -1
- package/lib/types/es6/Checkbox.d.ts +4 -1
- package/lib/types/es6/ColumnGrouping.d.ts +1 -0
- package/lib/types/es6/ColumnSelection.d.ts +5 -1
- package/lib/types/es6/Core/data/DataView.d.ts +16 -7
- package/lib/types/es6/Core/data/Segment.d.ts +2 -0
- package/lib/types/es6/Core/data/WrappedView.d.ts +289 -0
- package/lib/types/es6/Core/grid/Core.d.ts +13 -0
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +8 -0
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +10 -1
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +10 -1
- package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +4 -0
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +1 -1
- package/lib/types/es6/FilterInput.d.ts +4 -2
- package/lib/types/es6/InCellEditing.d.ts +1 -1
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +4 -1
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +15 -8
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -1
- package/lib/types/es6/RowColoring.d.ts +2 -0
- package/lib/types/es6/RowDragging.d.ts +1 -3
- package/lib/types/es6/RowFiltering.d.ts +2 -0
- package/lib/types/es6/RowSegmenting.d.ts +1 -0
- package/lib/types/es6/RowSelection.d.ts +13 -9
- package/lib/types/es6/Zoom.d.ts +2 -1
- package/lib/types/es6/index.d.ts +3 -0
- package/lib/versions.json +19 -19
- package/lib/zoom/es6/Zoom.d.ts +2 -1
- package/lib/zoom/es6/Zoom.js +11 -4
- package/package.json +9 -2
@@ -88,6 +88,9 @@ var Core = function (opt_initializer) {
|
|
88
88
|
_t._onColInViewChanged = _t._onColInViewChanged.bind(_t);
|
89
89
|
|
90
90
|
_t._updateVScrollbar = _t._updateVScrollbar.bind(_t);
|
91
|
+
_t._updateColumnBounds = _t._updateColumnBounds.bind(_t);
|
92
|
+
_t._dispatchColumnPositionChanged = _t._dispatchColumnPositionChanged.bind(_t);
|
93
|
+
_t._dispatchRowPositionChanged = _t._dispatchRowPositionChanged.bind(_t);
|
91
94
|
|
92
95
|
// Text nodes are unintentionally getting in the tag.
|
93
96
|
if(opt_initializer) { // Any node other than element node is not allowed within the tag.
|
@@ -159,6 +162,9 @@ var Core = function (opt_initializer) {
|
|
159
162
|
_t._colVirtualizer.listen("indexChanged", _t._onColInViewChanged);
|
160
163
|
_t._rowHeightConflator = new Conflator(_t._onRowHeightChanged, 50);
|
161
164
|
_t._vScrollbarConflator = new Conflator(_t._updateVScrollbar, 200);
|
165
|
+
_t._columnBoundConflator = new Conflator(_t._updateColumnBounds, 10);
|
166
|
+
_t._columnPositionConflator = new Conflator(_t._dispatchColumnPositionChanged, 10);
|
167
|
+
_t._rowPositionConflator = new Conflator(_t._dispatchRowPositionChanged, 10);
|
162
168
|
|
163
169
|
// Initialize events for external users
|
164
170
|
_t._addEvents(
|
@@ -179,7 +185,9 @@ var Core = function (opt_initializer) {
|
|
179
185
|
"rowHighlighted",
|
180
186
|
"preForcedUpdate",
|
181
187
|
"rowAdded",
|
182
|
-
"rowRemoved"
|
188
|
+
"rowRemoved",
|
189
|
+
"columnPositionChanged",
|
190
|
+
"rowPositionChanged"
|
183
191
|
);
|
184
192
|
|
185
193
|
// For debugging in advanced optimization mode
|
@@ -276,6 +284,9 @@ Core.CellReference;
|
|
276
284
|
* @property {Function=} renderingHandler - Deprecated
|
277
285
|
* @property {Function=} dataBindingHandler Column binding function
|
278
286
|
* @property {string=} columnData For attaching context (user data)
|
287
|
+
* @property {boolean=} stationary=false If enabled, the column order cannot be changed (i.e., this column and any column to its left cannot be moved)
|
288
|
+
* @property {boolean=} leftPinned=false If enabled, the column will not be part of the scrollable area and is pinned to the left side
|
289
|
+
* @property {boolean=} rightPinned=false If enabled, the column will not be part of the scrollable area and is pinned to the right side
|
279
290
|
* @property {TrackLayout=} layout - Deprecated
|
280
291
|
*/
|
281
292
|
Core.ColumnOptions;
|
@@ -334,14 +345,18 @@ Core.prototype._tempFrozenSectionRef = "";
|
|
334
345
|
* @private
|
335
346
|
*/
|
336
347
|
Core.prototype._startVScrollbarIndex = -1;
|
348
|
+
/** @type {boolean}
|
349
|
+
* @private
|
350
|
+
*/
|
351
|
+
Core.prototype._hScrollbarEnabled = true;
|
337
352
|
/** @type {number}
|
338
353
|
* @private
|
339
354
|
*/
|
340
|
-
Core.prototype.
|
355
|
+
Core.prototype._pinnedLeftColumnCount = 0; // Cached value, that should always the same as the actual value in the UI
|
341
356
|
/** @type {number}
|
342
357
|
* @private
|
343
358
|
*/
|
344
|
-
Core.prototype._pinnedRightColumnCount = 0;
|
359
|
+
Core.prototype._pinnedRightColumnCount = 0; // Cached value, that should always the same as the actual value in the UI
|
345
360
|
/** number of footer that being freeze right now
|
346
361
|
* @type {number}
|
347
362
|
* @private
|
@@ -456,6 +471,14 @@ Core.prototype._hidingMethod = "";
|
|
456
471
|
* @private
|
457
472
|
*/
|
458
473
|
Core.prototype._rowHeightConflator = null;
|
474
|
+
/** @type {Conflator}
|
475
|
+
* @private
|
476
|
+
*/
|
477
|
+
Core.prototype._vScrollbarConflator = null;
|
478
|
+
/** @type {Conflator}
|
479
|
+
* @private
|
480
|
+
*/
|
481
|
+
Core.prototype._columnBoundConflator = null;
|
459
482
|
/** @type {number}
|
460
483
|
* @private
|
461
484
|
*/
|
@@ -492,7 +515,7 @@ Core.prototype._preserveGridSize = false;
|
|
492
515
|
* @return {string}
|
493
516
|
*/
|
494
517
|
Core.getVersion = function () {
|
495
|
-
return "5.0.
|
518
|
+
return "5.0.53";
|
496
519
|
};
|
497
520
|
/** {@link ElementWrapper#dispose}
|
498
521
|
* @override
|
@@ -537,6 +560,11 @@ Core.prototype.dispose = function () {
|
|
537
560
|
this._vscrollbar.dispose();
|
538
561
|
this._hscrollbar.dispose();
|
539
562
|
this._rowHeightConflator.dispose();
|
563
|
+
this._vScrollbarConflator.dispose();
|
564
|
+
this._columnBoundConflator.dispose();
|
565
|
+
this._columnPositionConflator.dispose();
|
566
|
+
this._rowPositionConflator.dispose();
|
567
|
+
|
540
568
|
|
541
569
|
// Clean Top node
|
542
570
|
var elem = this._element;
|
@@ -606,17 +634,20 @@ Core.prototype.getConfigObject = function (gridOptions) {
|
|
606
634
|
if (columnDef["styles"]) {
|
607
635
|
column["styles"] = columnDef["styles"];
|
608
636
|
}
|
609
|
-
if (columnDef["stationary"]
|
637
|
+
if (columnDef["stationary"]) {
|
610
638
|
column["stationary"] = columnDef["stationary"];
|
611
639
|
}
|
640
|
+
if (columnDef["leftPinned"]) {
|
641
|
+
column["leftPinned"] = columnDef["leftPinned"];
|
642
|
+
}
|
643
|
+
if (columnDef["rightPinned"]) {
|
644
|
+
column["rightPinned"] = columnDef["rightPinned"];
|
645
|
+
}
|
612
646
|
}
|
613
647
|
|
614
648
|
if(this._rowHighlighting) {
|
615
649
|
obj["rowHighlighting"] = true;
|
616
650
|
}
|
617
|
-
if(this._pinnedRightColumnCount) {
|
618
|
-
obj["pinnedRightColumns"] = this._pinnedRightColumnCount;
|
619
|
-
}
|
620
651
|
obj["columnVirtualization"] = this._colVirtualizer.isEnabled();
|
621
652
|
|
622
653
|
if(this._fixFrozenTopSections) {
|
@@ -682,7 +713,7 @@ Core.prototype.fillParentWidth = function(pct) {
|
|
682
713
|
// exceeds expected value by 1px and will cause incorrect scrollbar active frag
|
683
714
|
var el = this._element;
|
684
715
|
var px = (el.getBoundingClientRect().width | 0) - el.clientLeft;
|
685
|
-
var changes = this._layoutX.setTrackSize(px
|
716
|
+
var changes = this._layoutX.setTrackSize(px - this._reservedSpace);
|
686
717
|
return changes !== null;
|
687
718
|
};
|
688
719
|
/** {@link ElementWrapper#show}
|
@@ -803,6 +834,10 @@ Core.prototype.addSectionAt = function (at, opt_type, opt_sectionName) {
|
|
803
834
|
}
|
804
835
|
|
805
836
|
this._updateSectionIndices(at);
|
837
|
+
if (this._autoSetDataSource) {
|
838
|
+
// This could trigger data binding and column virtualization
|
839
|
+
sectionSettings.setDataSource(this._dataSource);
|
840
|
+
}
|
806
841
|
|
807
842
|
sectType = sectionSettings.getType();
|
808
843
|
if (sectType === "footer") {
|
@@ -1302,23 +1337,11 @@ Core.prototype.insertColumn = function (index, jsonObj) {
|
|
1302
1337
|
section.insertColumn(index);
|
1303
1338
|
}
|
1304
1339
|
|
1305
|
-
|
1306
|
-
this.
|
1307
|
-
|
1308
|
-
if (prevCount > 0) {
|
1309
|
-
var leftPinnedCount = this._countPinnedLeftColumns();
|
1310
|
-
if ((index < leftPinnedCount) && (leftPinnedCount < prevCount + 1)) {
|
1311
|
-
// insert into left frozen zone
|
1312
|
-
this.freezeColumn(leftPinnedCount, rightPinnedCount);
|
1313
|
-
} else if (index > (prevCount - rightPinnedCount)) {
|
1314
|
-
// insert into right frozen zone
|
1315
|
-
this.freezeColumn(leftPinnedCount - 1, rightPinnedCount + 1);
|
1316
|
-
}
|
1317
|
-
}
|
1340
|
+
this._columnDefs.splice(index, 0, null); // TODO: Always initialize column def
|
1341
|
+
this._deserializeColumn(index, jsonObj); // Set leftPinned and other properties
|
1318
1342
|
|
1319
1343
|
this._onColumnCountChanged();
|
1320
|
-
this.
|
1321
|
-
this._syncLayoutToColumns(index, index + 1);
|
1344
|
+
this._syncLayoutToColumns(index, index + 1); // _updateScrollbarWidth should be called
|
1322
1345
|
|
1323
1346
|
this._dispatchColumnAddedEvent(index, 1, (index < prevCount), jsonObj);
|
1324
1347
|
};
|
@@ -1353,9 +1376,6 @@ Core.prototype.insertColumns = function (at, cols) {
|
|
1353
1376
|
}
|
1354
1377
|
if (count <= 0) { return; }
|
1355
1378
|
|
1356
|
-
var leftPinnedCount = this._countPinnedLeftColumns();
|
1357
|
-
var rightPinnedCount = this._countPinnedRightColumns();
|
1358
|
-
|
1359
1379
|
var prevState = this.freezeLayout();
|
1360
1380
|
var args = [at, 0].concat(new Array(count));
|
1361
1381
|
Array.prototype.splice.apply(this._columnDefs, args);
|
@@ -1371,21 +1391,9 @@ Core.prototype.insertColumns = function (at, cols) {
|
|
1371
1391
|
this._deserializeColumn(index, colDef);
|
1372
1392
|
}
|
1373
1393
|
|
1374
|
-
if (prevCount > 0) {
|
1375
|
-
if (at < leftPinnedCount) {
|
1376
|
-
// insert into left frozen zone
|
1377
|
-
this.freezeColumn(leftPinnedCount + count - 1, rightPinnedCount);
|
1378
|
-
} else if (at > (prevCount - rightPinnedCount)) {
|
1379
|
-
// insert into right frozen zone
|
1380
|
-
this.freezeColumn(leftPinnedCount - 1, rightPinnedCount + count);
|
1381
|
-
}
|
1382
|
-
} else if (leftPinnedCount + this._pinnedRightColumnCount < count) {
|
1383
|
-
this.freezeColumn(leftPinnedCount - 1, this._pinnedRightColumnCount);
|
1384
|
-
}
|
1385
|
-
|
1386
1394
|
this._dispatchColumnAddedEvent(at, count, (at < prevCount), colDefs);
|
1387
1395
|
|
1388
|
-
this.freezeLayout(prevState); // call _syncLayoutToColumns internally
|
1396
|
+
this.freezeLayout(prevState); // call _onColumnCountChanged and _syncLayoutToColumns internally
|
1389
1397
|
};
|
1390
1398
|
|
1391
1399
|
/** @public
|
@@ -1410,21 +1418,19 @@ Core.prototype.removeColumnAt = function (index) {
|
|
1410
1418
|
this._settings[i].getSection().removeColumnAt(index);
|
1411
1419
|
}
|
1412
1420
|
|
1413
|
-
var leftPinnedCount = this.
|
1414
|
-
var rightPinnedCount = this.
|
1421
|
+
var leftPinnedCount = this._pinnedLeftColumnCount;
|
1422
|
+
var rightPinnedCount = this._pinnedRightColumnCount;
|
1415
1423
|
|
1416
1424
|
var colDef = this._columnDefs.splice(index, 1)[0]; // width and styles
|
1417
1425
|
|
1426
|
+
this._onColumnCountChanged();
|
1427
|
+
// TODO: Column count changed may cause scroll pane to changed, and thus _updateScrollbarWidth should be included in the event handler
|
1418
1428
|
if (index < leftPinnedCount) {
|
1419
|
-
|
1420
|
-
this.freezeColumn(leftPinnedCount - 2, rightPinnedCount);
|
1429
|
+
this._updateScrollbarWidth(true, true);
|
1421
1430
|
} else if (index >= (colCount - rightPinnedCount)) {
|
1422
|
-
|
1423
|
-
this.freezeColumn(leftPinnedCount - 1, rightPinnedCount - 1);
|
1431
|
+
this._updateScrollbarWidth(true, true);
|
1424
1432
|
}
|
1425
|
-
|
1426
|
-
this._onColumnCountChanged();
|
1427
|
-
this._syncLayoutToColumns(index, colCount - 1, true); // TODO: There should be no change in column layout
|
1433
|
+
this._syncLayoutToColumns(index, colCount - 1, true); // WARNiNG: _updateScrollbarWidth may be called again here
|
1428
1434
|
|
1429
1435
|
if(!colDef) {
|
1430
1436
|
colDef = {};
|
@@ -1455,7 +1461,7 @@ Core.prototype.removeColumnAt = function (index) {
|
|
1455
1461
|
*/
|
1456
1462
|
Core.prototype.removeAllColumns = function () {
|
1457
1463
|
if (this.getColumnCount() > 0) {
|
1458
|
-
this.
|
1464
|
+
this._pinnedLeftColumnCount = 0;
|
1459
1465
|
this._pinnedRightColumnCount = 0;
|
1460
1466
|
this.setColumnCount(0);
|
1461
1467
|
}
|
@@ -1539,39 +1545,42 @@ Core.prototype.moveColumn = function (fromCol, destCol) {
|
|
1539
1545
|
}
|
1540
1546
|
|
1541
1547
|
var colDef = this._columnDefs[fromCol];
|
1548
|
+
var leftPinnedCount = this._countPinnedLeftColumns();
|
1542
1549
|
var rightPinnedCount = this._countPinnedRightColumns();
|
1543
1550
|
// var minColumn = (fromCol < destCol) ? fromCol : destCol;
|
1544
1551
|
Util.moveArrayItem(this._columnDefs, fromCol, destCol);
|
1545
1552
|
|
1546
|
-
if(
|
1547
|
-
|
1548
|
-
|
1549
|
-
if(destCol >= (colCount - rightPinnedCount)) {
|
1550
|
-
// moved into right frozen zone
|
1551
|
-
this.freezeColumn(this._startHScrollbarIndex - 2, rightPinnedCount + 1);
|
1552
|
-
} else if(destCol >= this._startHScrollbarIndex) {
|
1553
|
-
// moved out
|
1554
|
-
this.freezeColumn(this._startHScrollbarIndex - 2, rightPinnedCount);
|
1555
|
-
}
|
1556
|
-
} else if(colDef.rightPinned) {
|
1557
|
-
// Right pinned column
|
1558
|
-
|
1559
|
-
if(destCol < this._startHScrollbarIndex) {
|
1560
|
-
// moved into left frozen zone
|
1561
|
-
this.freezeColumn(this._startHScrollbarIndex, rightPinnedCount - 1);
|
1562
|
-
} else if(destCol < (colCount - rightPinnedCount)) {
|
1563
|
-
// moved out
|
1564
|
-
this.freezeColumn(this._startHScrollbarIndex - 1, rightPinnedCount - 1);
|
1565
|
-
}
|
1566
|
-
} else {
|
1567
|
-
// unpinned column
|
1553
|
+
if(this._hScrollbarEnabled) {
|
1554
|
+
if(fromCol < leftPinnedCount) {
|
1555
|
+
// Left pinned column
|
1568
1556
|
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1557
|
+
if(destCol >= (colCount - rightPinnedCount)) {
|
1558
|
+
// moved into right frozen zone
|
1559
|
+
this.freezeColumn(leftPinnedCount - 2, rightPinnedCount + 1);
|
1560
|
+
} else if(destCol >= leftPinnedCount) {
|
1561
|
+
// moved out
|
1562
|
+
this.freezeColumn(leftPinnedCount - 2, rightPinnedCount);
|
1563
|
+
}
|
1564
|
+
} else if(colDef["rightPinned"]) {
|
1565
|
+
// Right pinned column
|
1566
|
+
|
1567
|
+
if(destCol < leftPinnedCount) {
|
1568
|
+
// moved into left frozen zone
|
1569
|
+
this.freezeColumn(leftPinnedCount, rightPinnedCount - 1);
|
1570
|
+
} else if(destCol < (colCount - rightPinnedCount)) {
|
1571
|
+
// moved out
|
1572
|
+
this.freezeColumn(leftPinnedCount - 1, rightPinnedCount - 1);
|
1573
|
+
}
|
1574
|
+
} else {
|
1575
|
+
// unpinned column
|
1576
|
+
|
1577
|
+
if(destCol < leftPinnedCount) {
|
1578
|
+
// moved into left frozen zone
|
1579
|
+
this.freezeColumn(leftPinnedCount, rightPinnedCount);
|
1580
|
+
} else if(destCol >= (colCount - rightPinnedCount)) {
|
1581
|
+
// moved into right frozen zone
|
1582
|
+
this.freezeColumn(leftPinnedCount - 1, rightPinnedCount + 1);
|
1583
|
+
}
|
1575
1584
|
}
|
1576
1585
|
}
|
1577
1586
|
|
@@ -1647,12 +1656,20 @@ Core.prototype._deserializeColumn = function (index, jsonObj) {
|
|
1647
1656
|
var colDef = this._getColumnDef(index);
|
1648
1657
|
var value = jsonObj["dataColumnName"];
|
1649
1658
|
if (value != null) {
|
1650
|
-
colDef["dataColumnName"] =
|
1659
|
+
colDef["dataColumnName"] = value;
|
1651
1660
|
}
|
1652
1661
|
|
1653
1662
|
value = jsonObj["stationary"];
|
1654
1663
|
if (value != null) {
|
1655
|
-
colDef["stationary"] = value;
|
1664
|
+
colDef["stationary"] = value ? true : false;
|
1665
|
+
}
|
1666
|
+
value = jsonObj["leftPinned"];
|
1667
|
+
if (value != null) {
|
1668
|
+
colDef["leftPinned"] = value ? true : false;
|
1669
|
+
}
|
1670
|
+
value = jsonObj["rightPinned"];
|
1671
|
+
if (value != null) {
|
1672
|
+
colDef["rightPinned"] = value ? true : false;
|
1656
1673
|
}
|
1657
1674
|
|
1658
1675
|
this.setColumnRenderingHandler(index, jsonObj["renderingHandler"]);
|
@@ -2009,7 +2026,7 @@ Core.prototype.getColumnAlignment = function(colIndex) {
|
|
2009
2026
|
*/
|
2010
2027
|
Core.prototype.getColumnLeft = function (colIndex) {
|
2011
2028
|
var colDef = this._columnDefs[colIndex];
|
2012
|
-
if(colDef && colDef
|
2029
|
+
if(colDef && colDef["rightPinned"]) {
|
2013
2030
|
var gridWidth = this.getElement().clientWidth;
|
2014
2031
|
var contentWidth = this._layoutX.getTrackSize();
|
2015
2032
|
var colLeft = contentWidth < gridWidth ? contentWidth : gridWidth;
|
@@ -2018,7 +2035,7 @@ Core.prototype.getColumnLeft = function (colIndex) {
|
|
2018
2035
|
colLeft -= this._layoutX.getLaneSize(i);
|
2019
2036
|
}
|
2020
2037
|
return colLeft;
|
2021
|
-
} else if (this.
|
2038
|
+
} else if (this._hScrollbarEnabled && colIndex >= this._pinnedLeftColumnCount) {
|
2022
2039
|
return this._layoutX.getLaneStart(colIndex) - this._hscrollbar.getScrollLeft();
|
2023
2040
|
} else {
|
2024
2041
|
return this._layoutX.getLaneStart(colIndex);
|
@@ -2083,7 +2100,7 @@ Core.prototype._calculateColumnWidths = function (indices, widths) {
|
|
2083
2100
|
|
2084
2101
|
if (scalableCount < 1 || excess > 0) {
|
2085
2102
|
layoutX.resetLaneToDefaultSize();
|
2086
|
-
layoutX.setTrackSize(gridSize
|
2103
|
+
layoutX.setTrackSize(gridSize - this._reservedSpace);
|
2087
2104
|
fixedSize = 0;
|
2088
2105
|
for(i = 0; i < colCount; i++) {
|
2089
2106
|
if (settingCols[i]) { continue; }
|
@@ -2592,64 +2609,73 @@ Core.prototype.getFooterCount = function () {
|
|
2592
2609
|
* core.freezeColumn(0, 2); // Grid's horizontal scrollbar will affect only the middle part
|
2593
2610
|
*/
|
2594
2611
|
Core.prototype.freezeColumn = function (frozenColIndex, numRightColumn) {
|
2612
|
+
var i, colDef;
|
2613
|
+
var colCount = this.getColumnCount();
|
2614
|
+
var leftPinnedCount = 0;
|
2615
|
+
var rightPinnedCount = 0;
|
2595
2616
|
if (frozenColIndex || frozenColIndex === 0) {
|
2596
|
-
this.
|
2597
|
-
|
2598
|
-
|
2599
|
-
|
2600
|
-
|
2601
|
-
|
2602
|
-
|
2603
|
-
this,
|
2604
|
-
this._getAllSections(),
|
2605
|
-
this.getColumnCount(),
|
2606
|
-
this._countPinnedRightColumns()
|
2607
|
-
);
|
2617
|
+
this._hScrollbarEnabled = true;
|
2618
|
+
leftPinnedCount = (frozenColIndex >= 0) ? frozenColIndex + 1 : 0;
|
2619
|
+
this._pinnedLeftColumnCount = leftPinnedCount; // This variable is used for caching
|
2620
|
+
|
2621
|
+
for (i = 0; i < colCount; ++i) {
|
2622
|
+
colDef = this._getColumnDef(i);
|
2623
|
+
colDef["leftPinned"] = (--leftPinnedCount >= 0);
|
2608
2624
|
}
|
2625
|
+
} else {
|
2626
|
+
this._hScrollbarEnabled = false;
|
2609
2627
|
}
|
2610
2628
|
if(numRightColumn != null) {
|
2611
|
-
|
2629
|
+
rightPinnedCount = numRightColumn > 0 ? numRightColumn : 0;
|
2630
|
+
this._pinnedRightColumnCount = rightPinnedCount; // This variable is used for caching
|
2631
|
+
|
2632
|
+
for (i = colCount; --i >= 0;) {
|
2633
|
+
colDef = this._getColumnDef(i);
|
2634
|
+
colDef["rightPinned"] = (--rightPinnedCount >= 0);
|
2635
|
+
}
|
2612
2636
|
}
|
2613
2637
|
|
2614
2638
|
this._onColumnCountChanged(); // Activate horizontal scrollbar and column virtualization
|
2615
2639
|
this._updateScrollbarWidth(true, true);
|
2616
2640
|
};
|
2617
|
-
/** @private
|
2618
|
-
* @param {number} numRightColumn Number of columns on the right side to be fixed/pinned on the right side
|
2619
|
-
*/
|
2620
|
-
Core.prototype._pinRightColumns = function (numRightColumn) {
|
2621
|
-
this._pinnedRightColumnCount = numRightColumn;
|
2622
|
-
var len = this.getColumnCount();
|
2623
|
-
for (var i = len; --i >= 0;) {
|
2624
|
-
var colDef = this._getColumnDef(i);
|
2625
|
-
if(--numRightColumn >= 0) {
|
2626
|
-
colDef.rightPinned = true;
|
2627
|
-
} else if(colDef.rightPinned) {
|
2628
|
-
colDef.rightPinned = false;
|
2629
|
-
}
|
2630
|
-
}
|
2631
|
-
};
|
2632
2641
|
|
2633
2642
|
/** @private
|
2634
|
-
* @return {number}
|
2643
|
+
* @return {number} Array of number of left pinned column count and right pinned column count
|
2635
2644
|
*/
|
2636
2645
|
Core.prototype._countPinnedLeftColumns = function () {
|
2637
|
-
|
2646
|
+
var leftPinnedCount = 0;
|
2647
|
+
if(this._hScrollbarEnabled) {
|
2648
|
+
for (var i = this._columnDefs.length; --i >= 0;) {
|
2649
|
+
var colDef = this._columnDefs[i];
|
2650
|
+
if(colDef) {
|
2651
|
+
if(colDef["leftPinned"]) {
|
2652
|
+
leftPinnedCount = i + 1; // Use the first right most pinned column
|
2653
|
+
break;
|
2654
|
+
}
|
2655
|
+
}
|
2656
|
+
}
|
2657
|
+
}
|
2658
|
+
this._pinnedLeftColumnCount = leftPinnedCount; // This variable is used as a cache
|
2659
|
+
return leftPinnedCount;
|
2638
2660
|
};
|
2639
2661
|
/** @private
|
2640
2662
|
* @return {number} numRightColumn Number of columns on the right side to be fixed/pinned on the right side
|
2641
2663
|
*/
|
2642
2664
|
Core.prototype._countPinnedRightColumns = function () {
|
2643
|
-
var
|
2644
|
-
|
2645
|
-
var
|
2646
|
-
|
2647
|
-
|
2648
|
-
|
2649
|
-
|
2665
|
+
var rightPinnedCount = 0;
|
2666
|
+
if(this._hScrollbarEnabled) {
|
2667
|
+
var colCount = this._columnDefs.length;
|
2668
|
+
var i;
|
2669
|
+
for(i = 0; i < colCount; ++i) {
|
2670
|
+
var colDef = this._columnDefs[i];
|
2671
|
+
if(colDef && colDef["rightPinned"]) {
|
2672
|
+
break;
|
2673
|
+
}
|
2650
2674
|
}
|
2675
|
+
rightPinnedCount = colCount - i;
|
2651
2676
|
}
|
2652
|
-
|
2677
|
+
this._pinnedRightColumnCount = rightPinnedCount;
|
2678
|
+
return rightPinnedCount;
|
2653
2679
|
};
|
2654
2680
|
|
2655
2681
|
/** @public
|
@@ -2664,13 +2690,7 @@ Core.prototype.isPinnedColumn = function (colIndex) {
|
|
2664
2690
|
* @return {number}
|
2665
2691
|
*/
|
2666
2692
|
Core.prototype.getFrozenColumnCount = function() {
|
2667
|
-
|
2668
|
-
//Count maybe < 0 in the cass that null is passed to core.freezeColumn(null);
|
2669
|
-
//which indicates that the HScrollbar is disabled
|
2670
|
-
if (count < 0) {
|
2671
|
-
count = 0;
|
2672
|
-
}
|
2673
|
-
return count;
|
2693
|
+
return this._hScrollbarEnabled ? this._pinnedLeftColumnCount : 0;
|
2674
2694
|
};
|
2675
2695
|
/** Returns number of pinned left columns. This is an alias to getFrozenColumnCount
|
2676
2696
|
* @public
|
@@ -3102,7 +3122,7 @@ Core.prototype.getVScrollStartIndex = function () {
|
|
3102
3122
|
* @return {number}
|
3103
3123
|
*/
|
3104
3124
|
Core.prototype.getHScrollStartIndex = function () {
|
3105
|
-
return this.
|
3125
|
+
return this._hScrollbarEnabled ? this._pinnedLeftColumnCount : -1;
|
3106
3126
|
};
|
3107
3127
|
/** @public
|
3108
3128
|
* @param {number} colIndex
|
@@ -3124,7 +3144,7 @@ Core.prototype.scrollToColumn = function (colIndex, leftOfView) {
|
|
3124
3144
|
return false;
|
3125
3145
|
}
|
3126
3146
|
|
3127
|
-
var widthOffset = this.
|
3147
|
+
var widthOffset = this._hScrollbarEnabled ? this._layoutX.getLaneStart(this._pinnedLeftColumnCount) : 0;
|
3128
3148
|
var scrollLeft = this._hscrollbar.getScrollLeft();
|
3129
3149
|
var viewLeft = scrollLeft + widthOffset;
|
3130
3150
|
var viewWidth = this._hscrollbar.getWidth();
|
@@ -3604,7 +3624,7 @@ Core.prototype.getHiddenInput = function () {
|
|
3604
3624
|
* @see {@link http://help.dottoro.com/ljqmdirr.php}
|
3605
3625
|
*/
|
3606
3626
|
Core.prototype.focus = function () {
|
3607
|
-
var elem = this.
|
3627
|
+
var elem = this._hiddenInput;
|
3608
3628
|
var activeElem = document.activeElement;
|
3609
3629
|
if(elem && elem !== activeElem) {
|
3610
3630
|
var x = window.pageXOffset;
|
@@ -3728,10 +3748,221 @@ Core._defaultDataBinding = function(e) {
|
|
3728
3748
|
e.cell.setContent(e.dataValue);
|
3729
3749
|
};
|
3730
3750
|
|
3751
|
+
/** @public
|
3752
|
+
* @param {number} colIndex
|
3753
|
+
* @param {boolean=} selected
|
3754
|
+
*/
|
3755
|
+
Core.prototype.selectColumn = function (colIndex, selected) {
|
3756
|
+
for (var i = this._settings.length; --i >= 0; ) {
|
3757
|
+
this._settings[i].getSection().selectColumn(colIndex, selected);
|
3758
|
+
}
|
3759
|
+
this._updateColumnBounds();
|
3760
|
+
};
|
3761
|
+
/** @public
|
3762
|
+
* @param {number} colIndex
|
3763
|
+
* @return {boolean}
|
3764
|
+
*/
|
3765
|
+
Core.prototype.isSelectedColumn = function (colIndex) {
|
3766
|
+
var first = this._settings[0] || null;
|
3767
|
+
if(first) {
|
3768
|
+
return first.getSection().isSelectedColumn(colIndex);
|
3769
|
+
}
|
3770
|
+
return false;
|
3771
|
+
};
|
3772
|
+
|
3773
|
+
/** @private
|
3774
|
+
*/
|
3775
|
+
Core.prototype._updateColumnBounds = function () {
|
3776
|
+
if(this._columnBoundConflator.conflate()) {
|
3777
|
+
return;
|
3778
|
+
}
|
3779
|
+
|
3780
|
+
var len = this.getColumnCount();
|
3781
|
+
var lftIdx = -1;
|
3782
|
+
var rgtIdx = -1;
|
3783
|
+
var i;
|
3784
|
+
for(i = 0; i < len; ++i) {
|
3785
|
+
if(this.isSelectedColumn(i)) {
|
3786
|
+
rgtIdx = i;
|
3787
|
+
if(lftIdx < 0) {
|
3788
|
+
lftIdx = i;
|
3789
|
+
}
|
3790
|
+
}
|
3791
|
+
}
|
3792
|
+
var sectCount = this._settings.length;
|
3793
|
+
if(sectCount) {
|
3794
|
+
var section = this._settings[0].getSection();
|
3795
|
+
var positions = [0, 0];
|
3796
|
+
var noBorders = [false, false];
|
3797
|
+
section.calculateColumnBounds(lftIdx, rgtIdx, positions, noBorders);
|
3798
|
+
|
3799
|
+
for (i = sectCount; --i >= 0; ) {
|
3800
|
+
section = this._settings[i].getSection();
|
3801
|
+
section.updateColumnBounds(positions, noBorders);
|
3802
|
+
}
|
3803
|
+
}
|
3804
|
+
};
|
3805
|
+
|
3806
|
+
/** @public
|
3807
|
+
* @param {number} startColIndex INCLUSIVE
|
3808
|
+
* @param {number} endColIndex INCLUSIVE
|
3809
|
+
* @return {Object}
|
3810
|
+
*/
|
3811
|
+
Core.prototype.getColumnRect = function (startColIndex, endColIndex) {
|
3812
|
+
var gridWidth = this.getElement().clientWidth;
|
3813
|
+
var scrollViewSize = gridWidth;
|
3814
|
+
var hscrollbar = this._hscrollbar;
|
3815
|
+
if (hscrollbar.isActive()) {
|
3816
|
+
scrollViewSize = hscrollbar.getTrackSize();
|
3817
|
+
}
|
3818
|
+
|
3819
|
+
var left = 0;
|
3820
|
+
var width = 0;
|
3821
|
+
if (this._settings.length) {
|
3822
|
+
var section = this._settings[0].getSection();
|
3823
|
+
var positions = [0, 0];
|
3824
|
+
section.calculateColumnBounds(startColIndex, endColIndex, positions, []);
|
3825
|
+
left = positions[0];
|
3826
|
+
width = positions[1] - left;
|
3827
|
+
}
|
3828
|
+
var rect = {
|
3829
|
+
top: 0, // TODO: Support column grouping
|
3830
|
+
left: left,
|
3831
|
+
width: width,
|
3832
|
+
height: this._layoutY.getTrackSize(),
|
3833
|
+
leftPinnedIndex: this._pinnedLeftColumnCount - 1,
|
3834
|
+
rightPinnedIndex: this.getFirstPinnedRightIndex(),
|
3835
|
+
scrollViewSize: scrollViewSize,
|
3836
|
+
gridWidth: gridWidth
|
3837
|
+
};
|
3838
|
+
return rect;
|
3839
|
+
};
|
3840
|
+
|
3841
|
+
/** @public
|
3842
|
+
* @param {number} startRowIndex INCLUSIVE
|
3843
|
+
* @param {number} endRowIndex INCLUSIVE
|
3844
|
+
* @return {Object}
|
3845
|
+
*/
|
3846
|
+
Core.prototype.getRowRect = function (startRowIndex, endRowIndex) {
|
3847
|
+
var contentWidth = this._layoutX.getTrackSize();
|
3848
|
+
var gridElem = this.getElement();
|
3849
|
+
var gridWidth = gridElem.clientWidth;
|
3850
|
+
contentWidth = contentWidth < gridWidth ? contentWidth : gridWidth;
|
3851
|
+
|
3852
|
+
var section = this.getSection("content");
|
3853
|
+
var rowOffset = section ? section.getRowOffset() : 1;
|
3854
|
+
var layoutY = this._layoutY;
|
3855
|
+
var sectionOffsetPx = layoutY.getLaneStart(rowOffset);
|
3856
|
+
|
3857
|
+
var scrollTop = 0;
|
3858
|
+
var scrollViewSize = section.getHeight();
|
3859
|
+
var vscrollbar = this._vscrollbar;
|
3860
|
+
if (vscrollbar.isActive()) {
|
3861
|
+
scrollTop = vscrollbar.getScrollTop();
|
3862
|
+
scrollViewSize = vscrollbar.getTrackSize();
|
3863
|
+
}
|
3864
|
+
var scrollViewBottom = scrollViewSize + sectionOffsetPx;
|
3865
|
+
|
3866
|
+
var topPx = layoutY.getLaneStart(startRowIndex + rowOffset) - scrollTop;
|
3867
|
+
var bottomPx = layoutY.getLaneEnd(endRowIndex + rowOffset) - scrollTop;
|
3868
|
+
if (topPx < sectionOffsetPx) {
|
3869
|
+
topPx = sectionOffsetPx;
|
3870
|
+
} else if (topPx > scrollViewBottom) {
|
3871
|
+
topPx = scrollViewBottom;
|
3872
|
+
}
|
3873
|
+
if (bottomPx < sectionOffsetPx) {
|
3874
|
+
bottomPx = sectionOffsetPx;
|
3875
|
+
} else if (bottomPx > scrollViewBottom) {
|
3876
|
+
bottomPx = scrollViewBottom;
|
3877
|
+
}
|
3878
|
+
|
3879
|
+
// Change origin point from grid to section
|
3880
|
+
topPx -= sectionOffsetPx;
|
3881
|
+
bottomPx -= sectionOffsetPx;
|
3882
|
+
|
3883
|
+
var rect = {
|
3884
|
+
top: topPx,
|
3885
|
+
left: 0,
|
3886
|
+
width: contentWidth,
|
3887
|
+
height: bottomPx - topPx,
|
3888
|
+
scrollViewSize: scrollViewSize,
|
3889
|
+
scrollViewTop: sectionOffsetPx,
|
3890
|
+
scrollViewBottom: scrollViewBottom
|
3891
|
+
};
|
3892
|
+
return rect;
|
3893
|
+
};
|
3894
|
+
/** @public
|
3895
|
+
* @param {Object} configObj
|
3896
|
+
* @return {!Object}
|
3897
|
+
*/
|
3898
|
+
Core.prototype.normalizeConfig = function (configObj) {
|
3899
|
+
if(!configObj) {
|
3900
|
+
configObj = {};
|
3901
|
+
}
|
3902
|
+
var columns = configObj["columns"];
|
3903
|
+
var colCount = columns ? columns.length : 0;
|
3904
|
+
var i, column;
|
3905
|
+
|
3906
|
+
var freezingIndex = configObj["columnFreezing"];
|
3907
|
+
if(freezingIndex == null) {
|
3908
|
+
freezingIndex = configObj["freezeColumn"];
|
3909
|
+
}
|
3910
|
+
var pinnedRightColumns = configObj["pinnedRightColumns"] || configObj["frozenRightColumns"];
|
3911
|
+
if (pinnedRightColumns) {
|
3912
|
+
delete configObj["pinnedRightColumns"];
|
3913
|
+
delete configObj["frozenRightColumns"];
|
3914
|
+
|
3915
|
+
configObj["columnVirtualRendering"] = false;
|
3916
|
+
configObj["columnVirtualization"] = false;
|
3917
|
+
|
3918
|
+
for(i = colCount; --i >= 0;) {
|
3919
|
+
if(--pinnedRightColumns >= 0) {
|
3920
|
+
column = columns[i];
|
3921
|
+
if(column) {
|
3922
|
+
column["rightPinned"] = true;
|
3923
|
+
}
|
3924
|
+
}
|
3925
|
+
}
|
3926
|
+
}
|
3927
|
+
if(freezingIndex != null) {
|
3928
|
+
delete configObj["columnFreezing"];
|
3929
|
+
delete configObj["freezeColumn"];
|
3930
|
+
|
3931
|
+
if(freezingIndex >= 0) {
|
3932
|
+
if(columns) {
|
3933
|
+
column = columns[freezingIndex];
|
3934
|
+
if(column) {
|
3935
|
+
column["leftPinned"] = true;
|
3936
|
+
}
|
3937
|
+
}
|
3938
|
+
}
|
3939
|
+
}
|
3940
|
+
|
3941
|
+
return configObj;
|
3942
|
+
};
|
3731
3943
|
//#endregion Public Methods
|
3732
3944
|
|
3733
3945
|
//#region Private Methods
|
3734
3946
|
/** @private
|
3947
|
+
*/
|
3948
|
+
Core.prototype._dispatchColumnPositionChanged = function () {
|
3949
|
+
if(this._columnPositionConflator.conflate()) {
|
3950
|
+
return;
|
3951
|
+
}
|
3952
|
+
|
3953
|
+
this._dispatch("columnPositionChanged", { sender: this });
|
3954
|
+
};
|
3955
|
+
|
3956
|
+
/** @private
|
3957
|
+
*/
|
3958
|
+
Core.prototype._dispatchRowPositionChanged = function () {
|
3959
|
+
if(this._rowPositionConflator.conflate()) {
|
3960
|
+
return;
|
3961
|
+
}
|
3962
|
+
|
3963
|
+
this._dispatch("rowPositionChanged", { sender: this });
|
3964
|
+
};
|
3965
|
+
/** @private
|
3735
3966
|
* @return {!Array.<ILayoutGrid>}
|
3736
3967
|
*/
|
3737
3968
|
Core.prototype._getAllSections = function () {
|
@@ -3799,7 +4030,10 @@ Core.prototype._newSection = function (opt_type, sectionName) {
|
|
3799
4030
|
}
|
3800
4031
|
|
3801
4032
|
opt_type = this._toSectionType(opt_type);
|
3802
|
-
var
|
4033
|
+
var sectionOpt = {
|
4034
|
+
"horizontalScrollbar": this._hscrollbar
|
4035
|
+
};
|
4036
|
+
var section = (opt_type === "content") ? new VirtualizedLayoutGrid(sectionOpt) : new LayoutGrid(sectionOpt);
|
3803
4037
|
section._setContext(this);
|
3804
4038
|
|
3805
4039
|
var sectionSettings = new SectionSettings(section);
|
@@ -3826,9 +4060,6 @@ Core.prototype._newSection = function (opt_type, sectionName) {
|
|
3826
4060
|
section.listen("rowCountChanged", this._onRowCountChanged);
|
3827
4061
|
section.listen("rowHeightChanged", this._onRowHeightChanged);
|
3828
4062
|
|
3829
|
-
if (this._autoSetDataSource) {
|
3830
|
-
sectionSettings.setDataSource(this._dataSource);
|
3831
|
-
}
|
3832
4063
|
return sectionSettings;
|
3833
4064
|
};
|
3834
4065
|
|
@@ -4119,7 +4350,12 @@ Core.prototype._removeColumn = function (num) { // TODO: change the logic to us
|
|
4119
4350
|
*/
|
4120
4351
|
Core.prototype._onSectionDataChanged = function (e) {
|
4121
4352
|
if(this._dispatchingDataChanged) { return; } // Prevent infinite loop
|
4122
|
-
|
4353
|
+
|
4354
|
+
var colCount = this._layoutX.getLaneCount();
|
4355
|
+
this._dispatchingDataChanged = colCount ? true : false;
|
4356
|
+
if(!colCount) {
|
4357
|
+
return;
|
4358
|
+
}
|
4123
4359
|
|
4124
4360
|
var fromR = /** @type{number} */(e["fromRowIndex"]);
|
4125
4361
|
var toR = /** @type{number} */(e["toRowIndex"]);
|
@@ -4134,7 +4370,6 @@ Core.prototype._onSectionDataChanged = function (e) {
|
|
4134
4370
|
}
|
4135
4371
|
this._dispatch("preSectionDataBinding", e);
|
4136
4372
|
|
4137
|
-
var colCount = this._layoutX.getLaneCount();
|
4138
4373
|
var dataMap = this.getDataColumnMap();
|
4139
4374
|
for (var c = 0; c < colCount; ++c) {
|
4140
4375
|
if(section["isColumnActive"](c) && (this.isColumnVisible(c) || this._isAlwaysRenderColumn(c))) {
|
@@ -4186,12 +4421,16 @@ Core.prototype._updateScrollbar = function (scrollbar) {
|
|
4186
4421
|
*/
|
4187
4422
|
Core.prototype._onVScroll = function (e) {
|
4188
4423
|
this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()); // Trigger virtualization event
|
4424
|
+
this._dispatchRowPositionChanged();
|
4189
4425
|
};
|
4190
4426
|
/** @private
|
4191
4427
|
* @param {Object} e
|
4192
4428
|
*/
|
4193
4429
|
Core.prototype._onHScroll = function (e) {
|
4194
|
-
this.
|
4430
|
+
var scrollVal = this._hscrollbar.getScrollLeft();
|
4431
|
+
this._colVirtualizer.setViewOffset(scrollVal); // Trigger virtualization event
|
4432
|
+
this._updateColumnBounds();
|
4433
|
+
this._dispatchColumnPositionChanged();
|
4195
4434
|
};
|
4196
4435
|
/** @private
|
4197
4436
|
*/
|
@@ -4236,6 +4475,9 @@ Core.prototype._onRowInViewChanged = function (e) { // Triggered from virtualize
|
|
4236
4475
|
* @param {Object} e
|
4237
4476
|
*/
|
4238
4477
|
Core.prototype._onColInViewChanged = function (e) {
|
4478
|
+
if(!this.getColumnCount()) {
|
4479
|
+
return; // No column for activation and no cell to be rendered
|
4480
|
+
}
|
4239
4481
|
var pfi = e["prevFirstIndex"];
|
4240
4482
|
var pli = e["prevLastIndex"]; // INCLUSIVE
|
4241
4483
|
var fi = e["firstIndex"];
|
@@ -4298,7 +4540,7 @@ Core.prototype._getColActivationList = function (fi, li, first, last) {
|
|
4298
4540
|
li = this._colVirtualizer.getLastIndexInView();
|
4299
4541
|
}
|
4300
4542
|
|
4301
|
-
var leftPinnedIndex = this.
|
4543
|
+
var leftPinnedIndex = this.getHScrollStartIndex();
|
4302
4544
|
var rightPinnedIndex = this.getFirstPinnedRightIndex();
|
4303
4545
|
var activations = new Array(last + 1);
|
4304
4546
|
for (var c = first; c <= last; ++c) {
|
@@ -4488,6 +4730,8 @@ Core.prototype._onRowHeightChanged = function (e) {
|
|
4488
4730
|
this._updateScrollbarHeight(minSectionIndex < this._startVScrollbarIndex,
|
4489
4731
|
minSectionIndex >= this._startVScrollbarIndex);
|
4490
4732
|
}
|
4733
|
+
|
4734
|
+
this._dispatchRowPositionChanged();
|
4491
4735
|
};
|
4492
4736
|
/** @private
|
4493
4737
|
* @param {ILayoutGrid} s
|
@@ -4544,26 +4788,33 @@ Core.prototype._onSectionCountChanged = function (opt_suppressLayout) {
|
|
4544
4788
|
};
|
4545
4789
|
/** @private */
|
4546
4790
|
Core.prototype._onColumnCountChanged = function () {
|
4547
|
-
if(this._frozenLayout) { return; }
|
4791
|
+
if(this._frozenLayout || this._disposed) { return; }
|
4548
4792
|
|
4549
|
-
|
4793
|
+
// TODO: Optimize these methods during initialization
|
4794
|
+
var pinnedLeft = this._countPinnedLeftColumns();
|
4550
4795
|
var pinnedRight = this._countPinnedRightColumns();
|
4551
|
-
var pinnedLeft = this._startHScrollbarIndex >= 0 ? this._startHScrollbarIndex : colCount;
|
4552
4796
|
|
4553
|
-
|
4797
|
+
this._updateColumnBounds();
|
4798
|
+
|
4799
|
+
if (this._hScrollbarEnabled && pinnedLeft + pinnedRight < this.getColumnCount()) {
|
4554
4800
|
this._hscrollbar.enable();
|
4555
4801
|
this._colVirtualizer.activate();
|
4556
4802
|
|
4557
4803
|
this._hscrollbar.setScrollContent(
|
4558
4804
|
this,
|
4559
4805
|
this._getAllSections(),
|
4560
|
-
|
4806
|
+
pinnedLeft,
|
4561
4807
|
pinnedRight
|
4562
4808
|
);
|
4563
|
-
} else {
|
4809
|
+
} else { // All columns are pinned and thus no column is scrollable
|
4564
4810
|
this._hscrollbar.disable();
|
4565
4811
|
this._colVirtualizer.deactivate();
|
4812
|
+
|
4813
|
+
pinnedLeft = pinnedRight = 0;
|
4566
4814
|
}
|
4815
|
+
|
4816
|
+
this._element.classList.toggle("right-pinning", pinnedRight > 0 ? true : false);
|
4817
|
+
this._dispatchColumnPositionChanged();
|
4567
4818
|
};
|
4568
4819
|
|
4569
4820
|
/** @private
|
@@ -4705,7 +4956,7 @@ Core.prototype._updateScrollbarHeight = function (paneChanged, contentChanged, n
|
|
4705
4956
|
* @param {boolean} contentChanged
|
4706
4957
|
*/
|
4707
4958
|
Core.prototype._updateScrollbarWidth = function (paneChanged, contentChanged) {
|
4708
|
-
if (paneChanged && this.
|
4959
|
+
if (paneChanged && this._hScrollbarEnabled) {
|
4709
4960
|
// Scroll Frame
|
4710
4961
|
var gridElem = this.getElement();
|
4711
4962
|
var scrollFrame = this._hscrollbar.getParent();
|
@@ -4715,11 +4966,11 @@ Core.prototype._updateScrollbarWidth = function (paneChanged, contentChanged) {
|
|
4715
4966
|
}
|
4716
4967
|
|
4717
4968
|
// Frozen Area
|
4718
|
-
var leftFrozenArea = this._layoutX.getLaneStart(this.
|
4969
|
+
var leftFrozenArea = this._layoutX.getLaneStart(this._pinnedLeftColumnCount);
|
4719
4970
|
|
4720
4971
|
var colCount = this._layoutX.getLaneCount();
|
4721
4972
|
var rightFrozenArea = 0;
|
4722
|
-
var rightPinnedCount = this._countPinnedRightColumns();
|
4973
|
+
var rightPinnedCount = this._countPinnedRightColumns(); // TODO: Check if we need to do a recount here
|
4723
4974
|
if (rightPinnedCount) {
|
4724
4975
|
rightFrozenArea = this._layoutX.getLaneStart(colCount) -
|
4725
4976
|
this._layoutX.getLaneStart(colCount - rightPinnedCount);
|
@@ -4744,7 +4995,7 @@ Core.prototype._updateScrollbarWidth = function (paneChanged, contentChanged) {
|
|
4744
4995
|
viewSize = containerWidth;
|
4745
4996
|
}
|
4746
4997
|
this._colVirtualizer.setViewSize(viewSize / this._zoomFactor);
|
4747
|
-
this._colVirtualizer.setViewBounds(this.
|
4998
|
+
this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount, rightPinnedCount);
|
4748
4999
|
} else {
|
4749
5000
|
this._colVirtualizer.validateVirtualization(); // Content width may be changed
|
4750
5001
|
}
|
@@ -4818,8 +5069,10 @@ Core.prototype._syncLayoutToColumns = function (from, to, opt_forceDispatching)
|
|
4818
5069
|
}
|
4819
5070
|
|
4820
5071
|
// TODO: Check if "to" should be greater than or equal to first pinnied right index
|
4821
|
-
var
|
4822
|
-
this._updateScrollbarWidth(
|
5072
|
+
var paneChanged = forceUpdate || (from < this.getHScrollStartIndex()) || (to > this.getFirstPinnedRightIndex());
|
5073
|
+
this._updateScrollbarWidth(paneChanged, true /* contentChanged */);
|
5074
|
+
this._updateColumnBounds();
|
5075
|
+
this._dispatchColumnPositionChanged();
|
4823
5076
|
|
4824
5077
|
if (dirty || opt_forceDispatching) {
|
4825
5078
|
this._dispatch("widthChanged", {
|
@@ -4910,15 +5163,8 @@ Core.prototype._updateLayout = function () {
|
|
4910
5163
|
|
4911
5164
|
var sectionCount = this.getSectionCount();
|
4912
5165
|
for (var s = 0; s < sectionCount; ++s) {
|
4913
|
-
var
|
4914
|
-
|
4915
|
-
if(settings.getType() == "title") { // Currently we only need title to be updated
|
4916
|
-
section.updateLayout();
|
4917
|
-
}
|
4918
|
-
if(section.getReservedSpace()) {
|
4919
|
-
// TODO: should update right space's style inside section.updateLayout function
|
4920
|
-
section._updateRightSpaceStyle(this._hscrollbar.isActive() && !this._pinnedRightColumnCount);
|
4921
|
-
}
|
5166
|
+
var section = this._settings[s].getSection();
|
5167
|
+
section.updateLayout(); // Notify section about forced recalculation of the layout
|
4922
5168
|
}
|
4923
5169
|
};
|
4924
5170
|
|