@refinitiv-ui/efx-grid 6.0.1 → 6.0.2

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.
Files changed (133) hide show
  1. package/lib/column-selection-dialog/lib/column-selection-dialog.js +80 -18
  2. package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
  3. package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
  4. package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
  5. package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
  6. package/lib/core/dist/core.css +1 -1
  7. package/lib/core/dist/core.js +12961 -10749
  8. package/lib/core/dist/core.min.js +1 -1
  9. package/lib/core/es6/data/DataView.d.ts +22 -7
  10. package/lib/core/es6/data/DataView.js +176 -49
  11. package/lib/core/es6/data/WrappedView.d.ts +289 -0
  12. package/lib/core/es6/data/WrappedView.js +1319 -0
  13. package/lib/core/es6/grid/Core.d.ts +13 -0
  14. package/lib/core/es6/grid/Core.js +393 -155
  15. package/lib/core/es6/grid/ILayoutGrid.d.ts +8 -0
  16. package/lib/core/es6/grid/ILayoutGrid.js +45 -2
  17. package/lib/core/es6/grid/LayoutGrid.d.ts +10 -1
  18. package/lib/core/es6/grid/LayoutGrid.js +257 -82
  19. package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +10 -1
  20. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +314 -27
  21. package/lib/core/es6/grid/components/Column.js +8 -2
  22. package/lib/core/es6/grid/components/HScrollbar.d.ts +4 -0
  23. package/lib/core/es6/grid/components/HScrollbar.js +20 -4
  24. package/lib/core/es6/grid/util/TrackLayout.d.ts +1 -1
  25. package/lib/core/es6/grid/util/TrackLayout.js +2 -3
  26. package/lib/core/es6/tr-grid-theme.js +1 -1
  27. package/lib/filter-dialog/lib/filter-dialog.js +8 -6
  28. package/lib/grid/lib/efx-grid.d.ts +14 -7
  29. package/lib/grid/lib/efx-grid.js +113 -114
  30. package/lib/grid/themes/base.less +4 -2
  31. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  32. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  33. package/lib/grid/themes/halo/efx-grid.less +69 -32
  34. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  35. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  36. package/lib/grid/themes/solar/charcoal/efx-grid.js +1 -1
  37. package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
  38. package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
  39. package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
  40. package/lib/row-segmenting/es6/RowSegmenting.d.ts +1 -0
  41. package/lib/row-segmenting/es6/RowSegmenting.js +40 -11
  42. package/lib/rt-grid/dist/rt-grid.js +10290 -7864
  43. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  44. package/lib/rt-grid/es6/ColumnDefinition.d.ts +4 -1
  45. package/lib/rt-grid/es6/ColumnDefinition.js +3 -0
  46. package/lib/rt-grid/es6/Grid.d.ts +14 -7
  47. package/lib/rt-grid/es6/Grid.js +241 -74
  48. package/lib/rt-grid/es6/RowDefinition.d.ts +4 -1
  49. package/lib/rt-grid/es6/RowDefinition.js +52 -2
  50. package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +1 -1
  51. package/lib/tr-grid-cell-selection/es6/CellSelection.js +53 -40
  52. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +2 -0
  53. package/lib/tr-grid-checkbox/es6/Checkbox.js +29 -14
  54. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +1 -0
  55. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +10 -0
  56. package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +5 -1
  57. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +226 -4
  58. package/lib/tr-grid-column-stack/es6/ColumnStack.js +3 -0
  59. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +1 -0
  60. package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +4 -2
  61. package/lib/tr-grid-filter-input/es6/FilterInput.js +73 -10
  62. package/lib/tr-grid-row-dragging/es6/RowDragging.js +102 -12
  63. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
  64. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +88 -33
  65. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +41 -31
  66. package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +5 -1
  67. package/lib/tr-grid-row-selection/es6/RowSelection.js +188 -7
  68. package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +2 -0
  69. package/lib/tr-grid-rowcoloring/es6/RowColoring.js +36 -0
  70. package/lib/tr-grid-util/es6/CellPainter.d.ts +8 -8
  71. package/lib/tr-grid-util/es6/Conflator.d.ts +2 -2
  72. package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
  73. package/lib/tr-grid-util/es6/DateTime.d.ts +4 -4
  74. package/lib/tr-grid-util/es6/Delay.d.ts +1 -1
  75. package/lib/tr-grid-util/es6/Dom.d.ts +4 -4
  76. package/lib/tr-grid-util/es6/ElementWrapper.d.ts +1 -1
  77. package/lib/tr-grid-util/es6/ElfDate.d.ts +3 -3
  78. package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -4
  79. package/lib/tr-grid-util/es6/EventDispatcher.d.ts +1 -1
  80. package/lib/tr-grid-util/es6/FieldFormatter.d.ts +1 -1
  81. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +5 -5
  82. package/lib/tr-grid-util/es6/GridPlugin.d.ts +3 -3
  83. package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +1 -1
  84. package/lib/tr-grid-util/es6/MultiTableManager.d.ts +2 -2
  85. package/lib/tr-grid-util/es6/PercentBar.d.ts +1 -1
  86. package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
  87. package/lib/tr-grid-util/es6/Popup.d.ts +2 -2
  88. package/lib/tr-grid-util/es6/RequestQueue.d.ts +1 -1
  89. package/lib/tr-grid-util/es6/RowPainter.d.ts +3 -0
  90. package/lib/tr-grid-util/es6/RowPainter.js +66 -12
  91. package/lib/tr-grid-util/es6/SubTable.d.ts +9 -9
  92. package/lib/tr-grid-util/es6/Table.d.ts +13 -13
  93. package/lib/tr-grid-util/es6/TextHighlighter.d.ts +3 -3
  94. package/lib/tr-grid-util/es6/TickCodes.d.ts +2 -2
  95. package/lib/tr-grid-util/es6/TouchProxy.d.ts +1 -1
  96. package/lib/tr-grid-util/es6/Util.d.ts +6 -6
  97. package/lib/tr-grid-util/es6/formula/Engine.d.ts +5 -5
  98. package/lib/tr-grid-util/es6/formula/Formula.d.ts +3 -3
  99. package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
  100. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +2 -2
  101. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +4 -4
  102. package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
  103. package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
  104. package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +11 -11
  105. package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +7 -7
  106. package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +1 -1
  107. package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +1 -1
  108. package/lib/types/es6/CellSelection.d.ts +1 -1
  109. package/lib/types/es6/Checkbox.d.ts +2 -0
  110. package/lib/types/es6/ColumnGrouping.d.ts +1 -0
  111. package/lib/types/es6/ColumnSelection.d.ts +5 -1
  112. package/lib/types/es6/Core/data/DataView.d.ts +22 -7
  113. package/lib/types/es6/Core/data/WrappedView.d.ts +289 -0
  114. package/lib/types/es6/Core/grid/Core.d.ts +13 -0
  115. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +8 -0
  116. package/lib/types/es6/Core/grid/LayoutGrid.d.ts +10 -1
  117. package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +10 -1
  118. package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +4 -0
  119. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +1 -1
  120. package/lib/types/es6/FilterInput.d.ts +4 -2
  121. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +4 -1
  122. package/lib/types/es6/RealtimeGrid/Grid.d.ts +15 -8
  123. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -1
  124. package/lib/types/es6/RowColoring.d.ts +2 -0
  125. package/lib/types/es6/RowFiltering.d.ts +2 -0
  126. package/lib/types/es6/RowSegmenting.d.ts +1 -0
  127. package/lib/types/es6/RowSelection.d.ts +5 -1
  128. package/lib/types/es6/Zoom.d.ts +2 -1
  129. package/lib/types/es6/index.d.ts +2 -0
  130. package/lib/versions.json +17 -17
  131. package/lib/zoom/es6/Zoom.d.ts +2 -1
  132. package/lib/zoom/es6/Zoom.js +11 -4
  133. package/package.json +7 -7
@@ -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._startHScrollbarIndex = 0;
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.38";
518
+ return "5.0.50";
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"] != null) {
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, this._reservedSpace);
716
+ var changes = this._layoutX.setTrackSize(px - this._reservedSpace);
686
717
  return changes !== null;
687
718
  };
688
719
  /** {@link ElementWrapper#show}
@@ -1302,23 +1333,11 @@ Core.prototype.insertColumn = function (index, jsonObj) {
1302
1333
  section.insertColumn(index);
1303
1334
  }
1304
1335
 
1305
- var rightPinnedCount = this._countPinnedRightColumns();
1306
- this._columnDefs.splice(index, 0, null);
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
- }
1336
+ this._columnDefs.splice(index, 0, null); // TODO: Always initialize column def
1337
+ this._deserializeColumn(index, jsonObj); // Set leftPinned and other properties
1318
1338
 
1319
1339
  this._onColumnCountChanged();
1320
- this._deserializeColumn(index, jsonObj);
1321
- this._syncLayoutToColumns(index, index + 1);
1340
+ this._syncLayoutToColumns(index, index + 1); // _updateScrollbarWidth should be called
1322
1341
 
1323
1342
  this._dispatchColumnAddedEvent(index, 1, (index < prevCount), jsonObj);
1324
1343
  };
@@ -1353,9 +1372,6 @@ Core.prototype.insertColumns = function (at, cols) {
1353
1372
  }
1354
1373
  if (count <= 0) { return; }
1355
1374
 
1356
- var leftPinnedCount = this._countPinnedLeftColumns();
1357
- var rightPinnedCount = this._countPinnedRightColumns();
1358
-
1359
1375
  var prevState = this.freezeLayout();
1360
1376
  var args = [at, 0].concat(new Array(count));
1361
1377
  Array.prototype.splice.apply(this._columnDefs, args);
@@ -1371,21 +1387,9 @@ Core.prototype.insertColumns = function (at, cols) {
1371
1387
  this._deserializeColumn(index, colDef);
1372
1388
  }
1373
1389
 
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
1390
  this._dispatchColumnAddedEvent(at, count, (at < prevCount), colDefs);
1387
1391
 
1388
- this.freezeLayout(prevState); // call _syncLayoutToColumns internally
1392
+ this.freezeLayout(prevState); // call _onColumnCountChanged and _syncLayoutToColumns internally
1389
1393
  };
1390
1394
 
1391
1395
  /** @public
@@ -1410,21 +1414,19 @@ Core.prototype.removeColumnAt = function (index) {
1410
1414
  this._settings[i].getSection().removeColumnAt(index);
1411
1415
  }
1412
1416
 
1413
- var leftPinnedCount = this._countPinnedLeftColumns();
1414
- var rightPinnedCount = this._countPinnedRightColumns();
1417
+ var leftPinnedCount = this._pinnedLeftColumnCount;
1418
+ var rightPinnedCount = this._pinnedRightColumnCount;
1415
1419
 
1416
1420
  var colDef = this._columnDefs.splice(index, 1)[0]; // width and styles
1417
1421
 
1422
+ this._onColumnCountChanged();
1423
+ // TODO: Column count changed may cause scroll pane to changed, and thus _updateScrollbarWidth should be included in the event handler
1418
1424
  if (index < leftPinnedCount) {
1419
- // remove left frozen column
1420
- this.freezeColumn(leftPinnedCount - 2, rightPinnedCount);
1425
+ this._updateScrollbarWidth(true, true);
1421
1426
  } else if (index >= (colCount - rightPinnedCount)) {
1422
- // remove right frozen column
1423
- this.freezeColumn(leftPinnedCount - 1, rightPinnedCount - 1);
1427
+ this._updateScrollbarWidth(true, true);
1424
1428
  }
1425
-
1426
- this._onColumnCountChanged();
1427
- this._syncLayoutToColumns(index, colCount - 1, true); // TODO: There should be no change in column layout
1429
+ this._syncLayoutToColumns(index, colCount - 1, true); // WARNiNG: _updateScrollbarWidth may be called again here
1428
1430
 
1429
1431
  if(!colDef) {
1430
1432
  colDef = {};
@@ -1455,7 +1457,7 @@ Core.prototype.removeColumnAt = function (index) {
1455
1457
  */
1456
1458
  Core.prototype.removeAllColumns = function () {
1457
1459
  if (this.getColumnCount() > 0) {
1458
- this._startHScrollbarIndex = 0;
1460
+ this._pinnedLeftColumnCount = 0;
1459
1461
  this._pinnedRightColumnCount = 0;
1460
1462
  this.setColumnCount(0);
1461
1463
  }
@@ -1539,39 +1541,42 @@ Core.prototype.moveColumn = function (fromCol, destCol) {
1539
1541
  }
1540
1542
 
1541
1543
  var colDef = this._columnDefs[fromCol];
1544
+ var leftPinnedCount = this._countPinnedLeftColumns();
1542
1545
  var rightPinnedCount = this._countPinnedRightColumns();
1543
1546
  // var minColumn = (fromCol < destCol) ? fromCol : destCol;
1544
1547
  Util.moveArrayItem(this._columnDefs, fromCol, destCol);
1545
1548
 
1546
- if(fromCol < this._startHScrollbarIndex) {
1547
- // Left pinned column
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
1549
+ if(this._hScrollbarEnabled) {
1550
+ if(fromCol < leftPinnedCount) {
1551
+ // Left pinned column
1558
1552
 
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
1568
-
1569
- if(destCol < this._startHScrollbarIndex) {
1570
- // moved into left frozen zone
1571
- this.freezeColumn(this._startHScrollbarIndex, rightPinnedCount);
1572
- } else if(destCol >= (colCount - rightPinnedCount)) {
1573
- // moved into right frozen zone
1574
- this.freezeColumn(this._startHScrollbarIndex - 1, rightPinnedCount + 1);
1553
+ if(destCol >= (colCount - rightPinnedCount)) {
1554
+ // moved into right frozen zone
1555
+ this.freezeColumn(leftPinnedCount - 2, rightPinnedCount + 1);
1556
+ } else if(destCol >= leftPinnedCount) {
1557
+ // moved out
1558
+ this.freezeColumn(leftPinnedCount - 2, rightPinnedCount);
1559
+ }
1560
+ } else if(colDef["rightPinned"]) {
1561
+ // Right pinned column
1562
+
1563
+ if(destCol < leftPinnedCount) {
1564
+ // moved into left frozen zone
1565
+ this.freezeColumn(leftPinnedCount, rightPinnedCount - 1);
1566
+ } else if(destCol < (colCount - rightPinnedCount)) {
1567
+ // moved out
1568
+ this.freezeColumn(leftPinnedCount - 1, rightPinnedCount - 1);
1569
+ }
1570
+ } else {
1571
+ // unpinned column
1572
+
1573
+ if(destCol < leftPinnedCount) {
1574
+ // moved into left frozen zone
1575
+ this.freezeColumn(leftPinnedCount, rightPinnedCount);
1576
+ } else if(destCol >= (colCount - rightPinnedCount)) {
1577
+ // moved into right frozen zone
1578
+ this.freezeColumn(leftPinnedCount - 1, rightPinnedCount + 1);
1579
+ }
1575
1580
  }
1576
1581
  }
1577
1582
 
@@ -1647,12 +1652,20 @@ Core.prototype._deserializeColumn = function (index, jsonObj) {
1647
1652
  var colDef = this._getColumnDef(index);
1648
1653
  var value = jsonObj["dataColumnName"];
1649
1654
  if (value != null) {
1650
- colDef["dataColumnName"] = dataColumnName;
1655
+ colDef["dataColumnName"] = value;
1651
1656
  }
1652
1657
 
1653
1658
  value = jsonObj["stationary"];
1654
1659
  if (value != null) {
1655
- colDef["stationary"] = value;
1660
+ colDef["stationary"] = value ? true : false;
1661
+ }
1662
+ value = jsonObj["leftPinned"];
1663
+ if (value != null) {
1664
+ colDef["leftPinned"] = value ? true : false;
1665
+ }
1666
+ value = jsonObj["rightPinned"];
1667
+ if (value != null) {
1668
+ colDef["rightPinned"] = value ? true : false;
1656
1669
  }
1657
1670
 
1658
1671
  this.setColumnRenderingHandler(index, jsonObj["renderingHandler"]);
@@ -2009,7 +2022,7 @@ Core.prototype.getColumnAlignment = function(colIndex) {
2009
2022
  */
2010
2023
  Core.prototype.getColumnLeft = function (colIndex) {
2011
2024
  var colDef = this._columnDefs[colIndex];
2012
- if(colDef && colDef.rightPinned) {
2025
+ if(colDef && colDef["rightPinned"]) {
2013
2026
  var gridWidth = this.getElement().clientWidth;
2014
2027
  var contentWidth = this._layoutX.getTrackSize();
2015
2028
  var colLeft = contentWidth < gridWidth ? contentWidth : gridWidth;
@@ -2018,7 +2031,7 @@ Core.prototype.getColumnLeft = function (colIndex) {
2018
2031
  colLeft -= this._layoutX.getLaneSize(i);
2019
2032
  }
2020
2033
  return colLeft;
2021
- } else if (this._startHScrollbarIndex >= 0 && colIndex >= this._startHScrollbarIndex) {
2034
+ } else if (this._hScrollbarEnabled && colIndex >= this._pinnedLeftColumnCount) {
2022
2035
  return this._layoutX.getLaneStart(colIndex) - this._hscrollbar.getScrollLeft();
2023
2036
  } else {
2024
2037
  return this._layoutX.getLaneStart(colIndex);
@@ -2083,7 +2096,7 @@ Core.prototype._calculateColumnWidths = function (indices, widths) {
2083
2096
 
2084
2097
  if (scalableCount < 1 || excess > 0) {
2085
2098
  layoutX.resetLaneToDefaultSize();
2086
- layoutX.setTrackSize(gridSize, this._reservedSpace);
2099
+ layoutX.setTrackSize(gridSize - this._reservedSpace);
2087
2100
  fixedSize = 0;
2088
2101
  for(i = 0; i < colCount; i++) {
2089
2102
  if (settingCols[i]) { continue; }
@@ -2592,64 +2605,73 @@ Core.prototype.getFooterCount = function () {
2592
2605
  * core.freezeColumn(0, 2); // Grid's horizontal scrollbar will affect only the middle part
2593
2606
  */
2594
2607
  Core.prototype.freezeColumn = function (frozenColIndex, numRightColumn) {
2608
+ var i, colDef;
2609
+ var colCount = this.getColumnCount();
2610
+ var leftPinnedCount = 0;
2611
+ var rightPinnedCount = 0;
2595
2612
  if (frozenColIndex || frozenColIndex === 0) {
2596
- this._startHScrollbarIndex = (frozenColIndex >= 0) ? frozenColIndex + 1 : 0;
2597
- } else {
2598
- if (frozenColIndex == null) {
2599
- this._startHScrollbarIndex = 0;
2600
- } else {
2601
- this._startHScrollbarIndex = -1;
2602
- this._hscrollbar.setScrollContent( // TODO: Check if this is needed
2603
- this,
2604
- this._getAllSections(),
2605
- this.getColumnCount(),
2606
- this._countPinnedRightColumns()
2607
- );
2613
+ this._hScrollbarEnabled = true;
2614
+ leftPinnedCount = (frozenColIndex >= 0) ? frozenColIndex + 1 : 0;
2615
+ this._pinnedLeftColumnCount = leftPinnedCount; // This variable is used for caching
2616
+
2617
+ for (i = 0; i < colCount; ++i) {
2618
+ colDef = this._getColumnDef(i);
2619
+ colDef["leftPinned"] = (--leftPinnedCount >= 0);
2608
2620
  }
2621
+ } else {
2622
+ this._hScrollbarEnabled = false;
2609
2623
  }
2610
2624
  if(numRightColumn != null) {
2611
- this._pinRightColumns(numRightColumn > 0 ? numRightColumn : 0);
2625
+ rightPinnedCount = numRightColumn > 0 ? numRightColumn : 0;
2626
+ this._pinnedRightColumnCount = rightPinnedCount; // This variable is used for caching
2627
+
2628
+ for (i = colCount; --i >= 0;) {
2629
+ colDef = this._getColumnDef(i);
2630
+ colDef["rightPinned"] = (--rightPinnedCount >= 0);
2631
+ }
2612
2632
  }
2613
2633
 
2614
2634
  this._onColumnCountChanged(); // Activate horizontal scrollbar and column virtualization
2615
2635
  this._updateScrollbarWidth(true, true);
2616
2636
  };
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
2637
 
2633
2638
  /** @private
2634
- * @return {number} numLeftColumn Number of columns on the left side to be fixed/pinned on the left side
2639
+ * @return {number} Array of number of left pinned column count and right pinned column count
2635
2640
  */
2636
2641
  Core.prototype._countPinnedLeftColumns = function () {
2637
- return this._startHScrollbarIndex >= 0 ? this._startHScrollbarIndex : 0;
2642
+ var leftPinnedCount = 0;
2643
+ if(this._hScrollbarEnabled) {
2644
+ for (var i = this._columnDefs.length; --i >= 0;) {
2645
+ var colDef = this._columnDefs[i];
2646
+ if(colDef) {
2647
+ if(colDef["leftPinned"]) {
2648
+ leftPinnedCount = i + 1; // Use the first right most pinned column
2649
+ break;
2650
+ }
2651
+ }
2652
+ }
2653
+ }
2654
+ this._pinnedLeftColumnCount = leftPinnedCount; // This variable is used as a cache
2655
+ return leftPinnedCount;
2638
2656
  };
2639
2657
  /** @private
2640
2658
  * @return {number} numRightColumn Number of columns on the right side to be fixed/pinned on the right side
2641
2659
  */
2642
2660
  Core.prototype._countPinnedRightColumns = function () {
2643
- var sum = 0;
2644
- for(var i = this._columnDefs.length; --i >= 0;) {
2645
- var colDef = this._columnDefs[i];
2646
- if(colDef && colDef.rightPinned) {
2647
- ++sum;
2648
- } else {
2649
- break;
2661
+ var rightPinnedCount = 0;
2662
+ if(this._hScrollbarEnabled) {
2663
+ var colCount = this._columnDefs.length;
2664
+ var i;
2665
+ for(i = 0; i < colCount; ++i) {
2666
+ var colDef = this._columnDefs[i];
2667
+ if(colDef && colDef["rightPinned"]) {
2668
+ break;
2669
+ }
2650
2670
  }
2671
+ rightPinnedCount = colCount - i;
2651
2672
  }
2652
- return sum;
2673
+ this._pinnedRightColumnCount = rightPinnedCount;
2674
+ return rightPinnedCount;
2653
2675
  };
2654
2676
 
2655
2677
  /** @public
@@ -2664,13 +2686,7 @@ Core.prototype.isPinnedColumn = function (colIndex) {
2664
2686
  * @return {number}
2665
2687
  */
2666
2688
  Core.prototype.getFrozenColumnCount = function() {
2667
- var count = this._startHScrollbarIndex;
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;
2689
+ return this._hScrollbarEnabled ? this._pinnedLeftColumnCount : 0;
2674
2690
  };
2675
2691
  /** Returns number of pinned left columns. This is an alias to getFrozenColumnCount
2676
2692
  * @public
@@ -3102,7 +3118,7 @@ Core.prototype.getVScrollStartIndex = function () {
3102
3118
  * @return {number}
3103
3119
  */
3104
3120
  Core.prototype.getHScrollStartIndex = function () {
3105
- return this._startHScrollbarIndex;
3121
+ return this._hScrollbarEnabled ? this._pinnedLeftColumnCount : -1;
3106
3122
  };
3107
3123
  /** @public
3108
3124
  * @param {number} colIndex
@@ -3124,7 +3140,7 @@ Core.prototype.scrollToColumn = function (colIndex, leftOfView) {
3124
3140
  return false;
3125
3141
  }
3126
3142
 
3127
- var widthOffset = this._startHScrollbarIndex > 0 ? this._layoutX.getLaneStart(this._startHScrollbarIndex) : 0;
3143
+ var widthOffset = this._hScrollbarEnabled ? this._layoutX.getLaneStart(this._pinnedLeftColumnCount) : 0;
3128
3144
  var scrollLeft = this._hscrollbar.getScrollLeft();
3129
3145
  var viewLeft = scrollLeft + widthOffset;
3130
3146
  var viewWidth = this._hscrollbar.getWidth();
@@ -3604,7 +3620,7 @@ Core.prototype.getHiddenInput = function () {
3604
3620
  * @see {@link http://help.dottoro.com/ljqmdirr.php}
3605
3621
  */
3606
3622
  Core.prototype.focus = function () {
3607
- var elem = this._element;
3623
+ var elem = this._hiddenInput;
3608
3624
  var activeElem = document.activeElement;
3609
3625
  if(elem && elem !== activeElem) {
3610
3626
  var x = window.pageXOffset;
@@ -3728,10 +3744,221 @@ Core._defaultDataBinding = function(e) {
3728
3744
  e.cell.setContent(e.dataValue);
3729
3745
  };
3730
3746
 
3747
+ /** @public
3748
+ * @param {number} colIndex
3749
+ * @param {boolean=} selected
3750
+ */
3751
+ Core.prototype.selectColumn = function (colIndex, selected) {
3752
+ for (var i = this._settings.length; --i >= 0; ) {
3753
+ this._settings[i].getSection().selectColumn(colIndex, selected);
3754
+ }
3755
+ this._updateColumnBounds();
3756
+ };
3757
+ /** @public
3758
+ * @param {number} colIndex
3759
+ * @return {boolean}
3760
+ */
3761
+ Core.prototype.isSelectedColumn = function (colIndex) {
3762
+ var first = this._settings[0] || null;
3763
+ if(first) {
3764
+ return first.getSection().isSelectedColumn(colIndex);
3765
+ }
3766
+ return false;
3767
+ };
3768
+
3769
+ /** @private
3770
+ */
3771
+ Core.prototype._updateColumnBounds = function () {
3772
+ if(this._columnBoundConflator.conflate()) {
3773
+ return;
3774
+ }
3775
+
3776
+ var len = this.getColumnCount();
3777
+ var lftIdx = -1;
3778
+ var rgtIdx = -1;
3779
+ var i;
3780
+ for(i = 0; i < len; ++i) {
3781
+ if(this.isSelectedColumn(i)) {
3782
+ rgtIdx = i;
3783
+ if(lftIdx < 0) {
3784
+ lftIdx = i;
3785
+ }
3786
+ }
3787
+ }
3788
+ var sectCount = this._settings.length;
3789
+ if(sectCount) {
3790
+ var section = this._settings[0].getSection();
3791
+ var positions = [0, 0];
3792
+ var noBorders = [false, false];
3793
+ section.calculateColumnBounds(lftIdx, rgtIdx, positions, noBorders);
3794
+
3795
+ for (i = sectCount; --i >= 0; ) {
3796
+ section = this._settings[i].getSection();
3797
+ section.updateColumnBounds(positions, noBorders);
3798
+ }
3799
+ }
3800
+ };
3801
+
3802
+ /** @public
3803
+ * @param {number} startColIndex INCLUSIVE
3804
+ * @param {number} endColIndex INCLUSIVE
3805
+ * @return {Object}
3806
+ */
3807
+ Core.prototype.getColumnRect = function (startColIndex, endColIndex) {
3808
+ var gridWidth = this.getElement().clientWidth;
3809
+ var scrollViewSize = gridWidth;
3810
+ var hscrollbar = this._hscrollbar;
3811
+ if (hscrollbar.isActive()) {
3812
+ scrollViewSize = hscrollbar.getTrackSize();
3813
+ }
3814
+
3815
+ var left = 0;
3816
+ var width = 0;
3817
+ if (this._settings.length) {
3818
+ var section = this._settings[0].getSection();
3819
+ var positions = [0, 0];
3820
+ section.calculateColumnBounds(startColIndex, endColIndex, positions, []);
3821
+ left = positions[0];
3822
+ width = positions[1] - left;
3823
+ }
3824
+ var rect = {
3825
+ top: 0, // TODO: Support column grouping
3826
+ left: left,
3827
+ width: width,
3828
+ height: this._layoutY.getTrackSize(),
3829
+ leftPinnedIndex: this._pinnedLeftColumnCount - 1,
3830
+ rightPinnedIndex: this.getFirstPinnedRightIndex(),
3831
+ scrollViewSize: scrollViewSize,
3832
+ gridWidth: gridWidth
3833
+ };
3834
+ return rect;
3835
+ };
3836
+
3837
+ /** @public
3838
+ * @param {number} startRowIndex INCLUSIVE
3839
+ * @param {number} endRowIndex INCLUSIVE
3840
+ * @return {Object}
3841
+ */
3842
+ Core.prototype.getRowRect = function (startRowIndex, endRowIndex) {
3843
+ var contentWidth = this._layoutX.getTrackSize();
3844
+ var gridElem = this.getElement();
3845
+ var gridWidth = gridElem.clientWidth;
3846
+ contentWidth = contentWidth < gridWidth ? contentWidth : gridWidth;
3847
+
3848
+ var section = this.getSection("content");
3849
+ var rowOffset = section ? section.getRowOffset() : 1;
3850
+ var layoutY = this._layoutY;
3851
+ var sectionOffsetPx = layoutY.getLaneStart(rowOffset);
3852
+
3853
+ var scrollTop = 0;
3854
+ var scrollViewSize = section.getHeight();
3855
+ var vscrollbar = this._vscrollbar;
3856
+ if (vscrollbar.isActive()) {
3857
+ scrollTop = vscrollbar.getScrollTop();
3858
+ scrollViewSize = vscrollbar.getTrackSize();
3859
+ }
3860
+ var scrollViewBottom = scrollViewSize + sectionOffsetPx;
3861
+
3862
+ var topPx = layoutY.getLaneStart(startRowIndex + rowOffset) - scrollTop;
3863
+ var bottomPx = layoutY.getLaneEnd(endRowIndex + rowOffset) - scrollTop;
3864
+ if (topPx < sectionOffsetPx) {
3865
+ topPx = sectionOffsetPx;
3866
+ } else if (topPx > scrollViewBottom) {
3867
+ topPx = scrollViewBottom;
3868
+ }
3869
+ if (bottomPx < sectionOffsetPx) {
3870
+ bottomPx = sectionOffsetPx;
3871
+ } else if (bottomPx > scrollViewBottom) {
3872
+ bottomPx = scrollViewBottom;
3873
+ }
3874
+
3875
+ // Change origin point from grid to section
3876
+ topPx -= sectionOffsetPx;
3877
+ bottomPx -= sectionOffsetPx;
3878
+
3879
+ var rect = {
3880
+ top: topPx,
3881
+ left: 0,
3882
+ width: contentWidth,
3883
+ height: bottomPx - topPx,
3884
+ scrollViewSize: scrollViewSize,
3885
+ scrollViewTop: sectionOffsetPx,
3886
+ scrollViewBottom: scrollViewBottom
3887
+ };
3888
+ return rect;
3889
+ };
3890
+ /** @public
3891
+ * @param {Object} configObj
3892
+ * @return {!Object}
3893
+ */
3894
+ Core.prototype.normalizeConfig = function (configObj) {
3895
+ if(!configObj) {
3896
+ configObj = {};
3897
+ }
3898
+ var columns = configObj["columns"];
3899
+ var colCount = columns ? columns.length : 0;
3900
+ var i, column;
3901
+
3902
+ var freezingIndex = configObj["columnFreezing"];
3903
+ if(freezingIndex == null) {
3904
+ freezingIndex = configObj["freezeColumn"];
3905
+ }
3906
+ var pinnedRightColumns = configObj["pinnedRightColumns"] || configObj["frozenRightColumns"];
3907
+ if (pinnedRightColumns) {
3908
+ delete configObj["pinnedRightColumns"];
3909
+ delete configObj["frozenRightColumns"];
3910
+
3911
+ configObj["columnVirtualRendering"] = false;
3912
+ configObj["columnVirtualization"] = false;
3913
+
3914
+ for(i = colCount; --i >= 0;) {
3915
+ if(--pinnedRightColumns >= 0) {
3916
+ column = columns[i];
3917
+ if(column) {
3918
+ column["rightPinned"] = true;
3919
+ }
3920
+ }
3921
+ }
3922
+ }
3923
+ if(freezingIndex != null) {
3924
+ delete configObj["columnFreezing"];
3925
+ delete configObj["freezeColumn"];
3926
+
3927
+ if(freezingIndex >= 0) {
3928
+ if(columns) {
3929
+ column = columns[freezingIndex];
3930
+ if(column) {
3931
+ column["leftPinned"] = true;
3932
+ }
3933
+ }
3934
+ }
3935
+ }
3936
+
3937
+ return configObj;
3938
+ };
3731
3939
  //#endregion Public Methods
3732
3940
 
3733
3941
  //#region Private Methods
3734
3942
  /** @private
3943
+ */
3944
+ Core.prototype._dispatchColumnPositionChanged = function () {
3945
+ if(this._columnPositionConflator.conflate()) {
3946
+ return;
3947
+ }
3948
+
3949
+ this._dispatch("columnPositionChanged", { sender: this });
3950
+ };
3951
+
3952
+ /** @private
3953
+ */
3954
+ Core.prototype._dispatchRowPositionChanged = function () {
3955
+ if(this._rowPositionConflator.conflate()) {
3956
+ return;
3957
+ }
3958
+
3959
+ this._dispatch("rowPositionChanged", { sender: this });
3960
+ };
3961
+ /** @private
3735
3962
  * @return {!Array.<ILayoutGrid>}
3736
3963
  */
3737
3964
  Core.prototype._getAllSections = function () {
@@ -3799,7 +4026,10 @@ Core.prototype._newSection = function (opt_type, sectionName) {
3799
4026
  }
3800
4027
 
3801
4028
  opt_type = this._toSectionType(opt_type);
3802
- var section = (opt_type === "content") ? new VirtualizedLayoutGrid() : new LayoutGrid();
4029
+ var sectionOpt = {
4030
+ "horizontalScrollbar": this._hscrollbar
4031
+ };
4032
+ var section = (opt_type === "content") ? new VirtualizedLayoutGrid(sectionOpt) : new LayoutGrid(sectionOpt);
3803
4033
  section._setContext(this);
3804
4034
 
3805
4035
  var sectionSettings = new SectionSettings(section);
@@ -4186,12 +4416,16 @@ Core.prototype._updateScrollbar = function (scrollbar) {
4186
4416
  */
4187
4417
  Core.prototype._onVScroll = function (e) {
4188
4418
  this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()); // Trigger virtualization event
4419
+ this._dispatchRowPositionChanged();
4189
4420
  };
4190
4421
  /** @private
4191
4422
  * @param {Object} e
4192
4423
  */
4193
4424
  Core.prototype._onHScroll = function (e) {
4194
- this._colVirtualizer.setViewOffset(this._hscrollbar.getScrollLeft()); // Trigger virtualization event
4425
+ var scrollVal = this._hscrollbar.getScrollLeft();
4426
+ this._colVirtualizer.setViewOffset(scrollVal); // Trigger virtualization event
4427
+ this._updateColumnBounds();
4428
+ this._dispatchColumnPositionChanged();
4195
4429
  };
4196
4430
  /** @private
4197
4431
  */
@@ -4298,7 +4532,7 @@ Core.prototype._getColActivationList = function (fi, li, first, last) {
4298
4532
  li = this._colVirtualizer.getLastIndexInView();
4299
4533
  }
4300
4534
 
4301
- var leftPinnedIndex = this._startHScrollbarIndex;
4535
+ var leftPinnedIndex = this.getHScrollStartIndex();
4302
4536
  var rightPinnedIndex = this.getFirstPinnedRightIndex();
4303
4537
  var activations = new Array(last + 1);
4304
4538
  for (var c = first; c <= last; ++c) {
@@ -4488,6 +4722,8 @@ Core.prototype._onRowHeightChanged = function (e) {
4488
4722
  this._updateScrollbarHeight(minSectionIndex < this._startVScrollbarIndex,
4489
4723
  minSectionIndex >= this._startVScrollbarIndex);
4490
4724
  }
4725
+
4726
+ this._dispatchRowPositionChanged();
4491
4727
  };
4492
4728
  /** @private
4493
4729
  * @param {ILayoutGrid} s
@@ -4544,26 +4780,33 @@ Core.prototype._onSectionCountChanged = function (opt_suppressLayout) {
4544
4780
  };
4545
4781
  /** @private */
4546
4782
  Core.prototype._onColumnCountChanged = function () {
4547
- if(this._frozenLayout) { return; }
4783
+ if(this._frozenLayout || this._disposed) { return; }
4548
4784
 
4549
- var colCount = this.getColumnCount();
4785
+ // TODO: Optimize these methods during initialization
4786
+ var pinnedLeft = this._countPinnedLeftColumns();
4550
4787
  var pinnedRight = this._countPinnedRightColumns();
4551
- var pinnedLeft = this._startHScrollbarIndex >= 0 ? this._startHScrollbarIndex : colCount;
4788
+ ///
4789
+ this._updateColumnBounds();
4552
4790
 
4553
- if (pinnedLeft + pinnedRight < colCount) {
4791
+ if (this._hScrollbarEnabled && pinnedLeft + pinnedRight < this.getColumnCount()) {
4554
4792
  this._hscrollbar.enable();
4555
4793
  this._colVirtualizer.activate();
4556
4794
 
4557
4795
  this._hscrollbar.setScrollContent(
4558
4796
  this,
4559
4797
  this._getAllSections(),
4560
- this._startHScrollbarIndex,
4798
+ pinnedLeft,
4561
4799
  pinnedRight
4562
4800
  );
4563
- } else {
4801
+ } else { // All columns are pinned and thus no column is scrollable
4564
4802
  this._hscrollbar.disable();
4565
4803
  this._colVirtualizer.deactivate();
4804
+
4805
+ pinnedLeft = pinnedRight = 0;
4566
4806
  }
4807
+
4808
+ this._element.classList.toggle("right-pinning", pinnedRight > 0 ? true : false);
4809
+ this._dispatchColumnPositionChanged();
4567
4810
  };
4568
4811
 
4569
4812
  /** @private
@@ -4705,7 +4948,7 @@ Core.prototype._updateScrollbarHeight = function (paneChanged, contentChanged, n
4705
4948
  * @param {boolean} contentChanged
4706
4949
  */
4707
4950
  Core.prototype._updateScrollbarWidth = function (paneChanged, contentChanged) {
4708
- if (paneChanged && this._startHScrollbarIndex >= 0) {
4951
+ if (paneChanged && this._hScrollbarEnabled) {
4709
4952
  // Scroll Frame
4710
4953
  var gridElem = this.getElement();
4711
4954
  var scrollFrame = this._hscrollbar.getParent();
@@ -4715,11 +4958,11 @@ Core.prototype._updateScrollbarWidth = function (paneChanged, contentChanged) {
4715
4958
  }
4716
4959
 
4717
4960
  // Frozen Area
4718
- var leftFrozenArea = this._layoutX.getLaneStart(this._startHScrollbarIndex);
4961
+ var leftFrozenArea = this._layoutX.getLaneStart(this._pinnedLeftColumnCount);
4719
4962
 
4720
4963
  var colCount = this._layoutX.getLaneCount();
4721
4964
  var rightFrozenArea = 0;
4722
- var rightPinnedCount = this._countPinnedRightColumns();
4965
+ var rightPinnedCount = this._countPinnedRightColumns(); // TODO: Check if we need to do a recount here
4723
4966
  if (rightPinnedCount) {
4724
4967
  rightFrozenArea = this._layoutX.getLaneStart(colCount) -
4725
4968
  this._layoutX.getLaneStart(colCount - rightPinnedCount);
@@ -4744,7 +4987,7 @@ Core.prototype._updateScrollbarWidth = function (paneChanged, contentChanged) {
4744
4987
  viewSize = containerWidth;
4745
4988
  }
4746
4989
  this._colVirtualizer.setViewSize(viewSize / this._zoomFactor);
4747
- this._colVirtualizer.setViewBounds(this._startHScrollbarIndex, rightPinnedCount);
4990
+ this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount, rightPinnedCount);
4748
4991
  } else {
4749
4992
  this._colVirtualizer.validateVirtualization(); // Content width may be changed
4750
4993
  }
@@ -4818,8 +5061,10 @@ Core.prototype._syncLayoutToColumns = function (from, to, opt_forceDispatching)
4818
5061
  }
4819
5062
 
4820
5063
  // TODO: Check if "to" should be greater than or equal to first pinnied right index
4821
- var shouldUpdate = forceUpdate || (from < this._startHScrollbarIndex) || (to > this.getFirstPinnedRightIndex());
4822
- this._updateScrollbarWidth(shouldUpdate, true);
5064
+ var paneChanged = forceUpdate || (from < this.getHScrollStartIndex()) || (to > this.getFirstPinnedRightIndex());
5065
+ this._updateScrollbarWidth(paneChanged, true /* contentChanged */);
5066
+ this._updateColumnBounds();
5067
+ this._dispatchColumnPositionChanged();
4823
5068
 
4824
5069
  if (dirty || opt_forceDispatching) {
4825
5070
  this._dispatch("widthChanged", {
@@ -4910,15 +5155,8 @@ Core.prototype._updateLayout = function () {
4910
5155
 
4911
5156
  var sectionCount = this.getSectionCount();
4912
5157
  for (var s = 0; s < sectionCount; ++s) {
4913
- var settings = this._settings[s];
4914
- var section = settings.getSection();
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
- }
5158
+ var section = this._settings[s].getSection();
5159
+ section.updateLayout(); // Notify section about forced recalculation of the layout
4922
5160
  }
4923
5161
  };
4924
5162