@openui5/sap.ui.table 1.123.1 → 1.124.0
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/.eslintrc.json +9 -1
- package/package.json +3 -3
- package/src/sap/ui/table/.library +1 -1
- package/src/sap/ui/table/AnalyticalColumn.js +40 -40
- package/src/sap/ui/table/AnalyticalColumnMenu.js +11 -11
- package/src/sap/ui/table/AnalyticalTable.js +107 -107
- package/src/sap/ui/table/Column.js +83 -83
- package/src/sap/ui/table/ColumnMenu.js +54 -54
- package/src/sap/ui/table/CreationRow.js +29 -29
- package/src/sap/ui/table/CreationRowRenderer.js +21 -21
- package/src/sap/ui/table/Row.js +55 -56
- package/src/sap/ui/table/RowAction.js +27 -27
- package/src/sap/ui/table/RowActionItem.js +7 -7
- package/src/sap/ui/table/RowActionRenderer.js +3 -3
- package/src/sap/ui/table/RowSettings.js +28 -37
- package/src/sap/ui/table/Table.js +263 -266
- package/src/sap/ui/table/TablePersoController.js +46 -46
- package/src/sap/ui/table/TableRenderer.js +112 -113
- package/src/sap/ui/table/TreeTable.js +16 -16
- package/src/sap/ui/table/designtime/Table.designtime.js +2 -2
- package/src/sap/ui/table/extensions/Accessibility.js +185 -181
- package/src/sap/ui/table/extensions/AccessibilityRender.js +15 -15
- package/src/sap/ui/table/extensions/DragAndDrop.js +47 -47
- package/src/sap/ui/table/extensions/ExtensionBase.js +9 -9
- package/src/sap/ui/table/extensions/Keyboard.js +40 -40
- package/src/sap/ui/table/extensions/KeyboardDelegate.js +257 -264
- package/src/sap/ui/table/extensions/Pointer.js +108 -109
- package/src/sap/ui/table/extensions/Scrolling.js +289 -285
- package/src/sap/ui/table/extensions/ScrollingIOS.js +50 -50
- package/src/sap/ui/table/extensions/Synchronization.js +32 -32
- package/src/sap/ui/table/library.js +12 -12
- package/src/sap/ui/table/menus/ColumnHeaderMenuAdapter.js +9 -9
- package/src/sap/ui/table/menus/LegacyColumnMenuAdapter.js +35 -37
- package/src/sap/ui/table/menus/MobileColumnHeaderMenuAdapter.js +23 -23
- package/src/sap/ui/table/messagebundle_sh.properties +9 -9
- package/src/sap/ui/table/plugins/BindingSelection.js +26 -25
- package/src/sap/ui/table/plugins/MultiSelectionPlugin.js +77 -32
- package/src/sap/ui/table/plugins/ODataV4Selection.js +81 -35
- package/src/sap/ui/table/plugins/PluginBase.js +12 -12
- package/src/sap/ui/table/plugins/SelectionModelSelection.js +13 -12
- package/src/sap/ui/table/plugins/SelectionPlugin.js +3 -3
- package/src/sap/ui/table/plugins/V4Aggregation.js +38 -38
- package/src/sap/ui/table/rowmodes/Auto.js +59 -61
- package/src/sap/ui/table/rowmodes/Fixed.js +18 -18
- package/src/sap/ui/table/rowmodes/Interactive.js +42 -44
- package/src/sap/ui/table/rowmodes/RowMode.js +64 -63
- package/src/sap/ui/table/rowmodes/Type.js +1 -1
- package/src/sap/ui/table/rowmodes/Variable.js +4 -4
- package/src/sap/ui/table/rules/Accessibility.support.js +15 -16
- package/src/sap/ui/table/rules/Binding.support.js +11 -11
- package/src/sap/ui/table/rules/ColumnTemplate.support.js +10 -10
- package/src/sap/ui/table/rules/Plugins.support.js +7 -7
- package/src/sap/ui/table/rules/Rows.support.js +29 -29
- package/src/sap/ui/table/rules/TableHelper.support.js +10 -10
- package/src/sap/ui/table/themes/base/library.source.less +2 -0
- package/src/sap/ui/table/utils/TableUtils.js +130 -128
- package/src/sap/ui/table/utils/_BindingUtils.js +7 -7
- package/src/sap/ui/table/utils/_ColumnUtils.js +98 -97
- package/src/sap/ui/table/utils/_GroupingUtils.js +56 -56
- package/src/sap/ui/table/utils/_HookUtils.js +26 -26
- package/src/sap/ui/table/utils/_MenuUtils.js +19 -19
|
@@ -38,21 +38,21 @@ sap.ui.define([
|
|
|
38
38
|
) {
|
|
39
39
|
"use strict";
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const HorizontalAlign = CoreLibrary.HorizontalAlign;
|
|
42
|
+
const SortOrder = CoreLibrary.SortOrder;
|
|
43
|
+
const ValueState = CoreLibrary.ValueState;
|
|
44
|
+
const TemplateType = {
|
|
45
45
|
Standard: "Standard",
|
|
46
46
|
Creation: "Creation"
|
|
47
47
|
};
|
|
48
|
-
|
|
48
|
+
const _private = TableUtils.createWeakMapFacade();
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Map from cell to column.
|
|
52
52
|
*
|
|
53
53
|
* @type {WeakMapConstructor}
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
const CellMap = new window.WeakMap();
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* Constructor for a new Column.
|
|
@@ -63,13 +63,13 @@ sap.ui.define([
|
|
|
63
63
|
* @class
|
|
64
64
|
* The column allows you to define column specific properties that will be applied when rendering the table.
|
|
65
65
|
* @extends sap.ui.core.Element
|
|
66
|
-
* @version 1.
|
|
66
|
+
* @version 1.124.0
|
|
67
67
|
*
|
|
68
68
|
* @constructor
|
|
69
69
|
* @public
|
|
70
70
|
* @alias sap.ui.table.Column
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
const Column = Element.extend("sap.ui.table.Column", /** @lends sap.ui.table.Column.prototype */ {metadata: {
|
|
73
73
|
|
|
74
74
|
library: "sap.ui.table",
|
|
75
75
|
properties: {
|
|
@@ -435,7 +435,7 @@ sap.ui.define([
|
|
|
435
435
|
};
|
|
436
436
|
|
|
437
437
|
Column.prototype.setLabel = function(vLabel) {
|
|
438
|
-
|
|
438
|
+
let oLabel = vLabel;
|
|
439
439
|
|
|
440
440
|
if (typeof vLabel === "string") {
|
|
441
441
|
if (_private(this).bHasDefaultLabel) {
|
|
@@ -452,7 +452,7 @@ sap.ui.define([
|
|
|
452
452
|
if (oLabel && oLabel.setIsInColumnHeaderContext) {
|
|
453
453
|
oLabel.setIsInColumnHeaderContext(true);
|
|
454
454
|
}
|
|
455
|
-
|
|
455
|
+
const oCurrLabel = this.getLabel();
|
|
456
456
|
if (oCurrLabel && oLabel !== oCurrLabel && oCurrLabel.setIsInColumnHeaderContext) {
|
|
457
457
|
oCurrLabel.setIsInColumnHeaderContext(false);
|
|
458
458
|
}
|
|
@@ -461,10 +461,10 @@ sap.ui.define([
|
|
|
461
461
|
};
|
|
462
462
|
|
|
463
463
|
Column.prototype.setTemplate = function(vTemplate) {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
464
|
+
let oTemplate = vTemplate;
|
|
465
|
+
const oTable = this._getTable();
|
|
466
|
+
const oOldTemplate = this.getTemplate();
|
|
467
|
+
let bNewTemplate = true;
|
|
468
468
|
|
|
469
469
|
if (typeof vTemplate === "string") {
|
|
470
470
|
if (_private(this).bHasDefaulTemplate) {
|
|
@@ -498,7 +498,7 @@ sap.ui.define([
|
|
|
498
498
|
}
|
|
499
499
|
|
|
500
500
|
if (!oOldTemplate || !oTemplate) {
|
|
501
|
-
|
|
501
|
+
const oCreationRow = oTable.getCreationRow();
|
|
502
502
|
if (oCreationRow) {
|
|
503
503
|
oCreationRow._update();
|
|
504
504
|
}
|
|
@@ -512,8 +512,8 @@ sap.ui.define([
|
|
|
512
512
|
this.destroyAggregation("template");
|
|
513
513
|
this._destroyTemplateClones("Standard");
|
|
514
514
|
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
const oTable = this._getTable();
|
|
516
|
+
const oCreationRow = oTable ? oTable.getCreationRow() : null;
|
|
517
517
|
|
|
518
518
|
if (oCreationRow) {
|
|
519
519
|
oCreationRow._update();
|
|
@@ -531,13 +531,13 @@ sap.ui.define([
|
|
|
531
531
|
* @ui5-restricted sap.ui.mdc
|
|
532
532
|
*/
|
|
533
533
|
Column.prototype.setCreationTemplate = function(oCreationTemplate) {
|
|
534
|
-
|
|
534
|
+
const oTable = this._getTable();
|
|
535
535
|
|
|
536
536
|
this.setAggregation("creationTemplate", oCreationTemplate, true);
|
|
537
537
|
this._destroyTemplateClones("Creation");
|
|
538
538
|
|
|
539
539
|
if (oCreationTemplate && oTable && this.getVisible()) {
|
|
540
|
-
|
|
540
|
+
const oCreationRow = oTable.getCreationRow();
|
|
541
541
|
if (oCreationRow) {
|
|
542
542
|
oCreationRow._update();
|
|
543
543
|
}
|
|
@@ -578,8 +578,8 @@ sap.ui.define([
|
|
|
578
578
|
* @deprecated As of Version 1.117
|
|
579
579
|
*/
|
|
580
580
|
Column.prototype._menuHasItems = function() {
|
|
581
|
-
|
|
582
|
-
|
|
581
|
+
const oTable = this._getTable();
|
|
582
|
+
const bHasOwnItems = (oTable ? oTable.getEnableColumnFreeze() : false)
|
|
583
583
|
|| (oTable ? oTable.getShowColumnVisibilityMenu() : false)
|
|
584
584
|
|| this.isSortableByMenu()
|
|
585
585
|
|| this.isFilterableByMenu()
|
|
@@ -629,12 +629,12 @@ sap.ui.define([
|
|
|
629
629
|
* @returns {boolean}
|
|
630
630
|
*/
|
|
631
631
|
Column.prototype.isGroupableByMenu = function() {
|
|
632
|
-
|
|
632
|
+
const oTable = this._getTable();
|
|
633
633
|
return !!(oTable && oTable.getEnableGrouping && oTable.getEnableGrouping() && this.getSortProperty());
|
|
634
634
|
};
|
|
635
635
|
|
|
636
636
|
Column.prototype._isGroupableByMenu = function() {
|
|
637
|
-
|
|
637
|
+
let bIsGroupableByMenu = false;
|
|
638
638
|
/**
|
|
639
639
|
* @deprecated As of version 1.119.
|
|
640
640
|
*/
|
|
@@ -664,7 +664,7 @@ sap.ui.define([
|
|
|
664
664
|
};
|
|
665
665
|
|
|
666
666
|
Column.prototype._openHeaderMenu = function(oDomRef) {
|
|
667
|
-
|
|
667
|
+
const oHeaderMenu = this.getHeaderMenuInstance();
|
|
668
668
|
/**
|
|
669
669
|
* @deprecated As of Version 1.117
|
|
670
670
|
*/
|
|
@@ -677,7 +677,7 @@ sap.ui.define([
|
|
|
677
677
|
};
|
|
678
678
|
|
|
679
679
|
Column.prototype._isHeaderMenuOpen = function() {
|
|
680
|
-
|
|
680
|
+
const oHeaderMenu = this.getHeaderMenuInstance();
|
|
681
681
|
if (oHeaderMenu) {
|
|
682
682
|
return oHeaderMenu.isOpen();
|
|
683
683
|
}
|
|
@@ -688,7 +688,7 @@ sap.ui.define([
|
|
|
688
688
|
* @private
|
|
689
689
|
*/
|
|
690
690
|
Column.prototype._setGrouped = function(bGrouped) {
|
|
691
|
-
|
|
691
|
+
const oTable = this._getTable();
|
|
692
692
|
oTable.setGroupBy(bGrouped ? this : null);
|
|
693
693
|
};
|
|
694
694
|
|
|
@@ -730,13 +730,13 @@ sap.ui.define([
|
|
|
730
730
|
* has no effect if the column is unsorted.
|
|
731
731
|
*/
|
|
732
732
|
Column.prototype._sort = function(sSortOrder, bAdd) {
|
|
733
|
-
|
|
733
|
+
const oTable = this._getTable();
|
|
734
734
|
|
|
735
735
|
if (!oTable || this.getSortProperty() === "") {
|
|
736
736
|
return;
|
|
737
737
|
}
|
|
738
738
|
|
|
739
|
-
|
|
739
|
+
const bExecuteDefault = oTable.fireSort({
|
|
740
740
|
column: this,
|
|
741
741
|
sortOrder: sSortOrder,
|
|
742
742
|
columnAdded: sSortOrder !== SortOrder.None && bAdd === true
|
|
@@ -759,10 +759,10 @@ sap.ui.define([
|
|
|
759
759
|
};
|
|
760
760
|
|
|
761
761
|
Column.prototype._updateSorters = function() {
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
762
|
+
const oTable = this._getTable();
|
|
763
|
+
const aSortedColumns = oTable.getSortedColumns();
|
|
764
|
+
const aColumns = oTable.getColumns();
|
|
765
|
+
const sSortOrder = this.getSortOrder();
|
|
766
766
|
|
|
767
767
|
// Reset the sorting status of all columns which are not sorted anymore.
|
|
768
768
|
for (let i = 0, l = aColumns.length; i < l; i++) {
|
|
@@ -810,16 +810,15 @@ sap.ui.define([
|
|
|
810
810
|
};
|
|
811
811
|
|
|
812
812
|
Column.prototype._getFilter = function() {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
aBetween;
|
|
813
|
+
let oFilter;
|
|
814
|
+
const sPath = this.getFilterProperty();
|
|
815
|
+
const sValue = this.getFilterValue();
|
|
816
|
+
let sOperator = this.getFilterOperator();
|
|
817
|
+
let sParsedValue;
|
|
818
|
+
let sSecondaryParsedValue;
|
|
819
|
+
const oType = this.getFilterType() || Column._DEFAULT_FILTER_TYPE;
|
|
820
|
+
const bIsString = oType instanceof StringType;
|
|
821
|
+
let aBetween;
|
|
823
822
|
|
|
824
823
|
if (sValue) {
|
|
825
824
|
|
|
@@ -829,22 +828,22 @@ sap.ui.define([
|
|
|
829
828
|
aBetween = sValue.match(/(.*)\s*\.\.\s*(.*)/);
|
|
830
829
|
|
|
831
830
|
// determine the filter operator depending on the
|
|
832
|
-
if (sValue.indexOf("=")
|
|
831
|
+
if (sValue.indexOf("=") === 0) {
|
|
833
832
|
sOperator = FilterOperator.EQ;
|
|
834
833
|
sParsedValue = sValue.substr(1);
|
|
835
|
-
} else if (sValue.indexOf("!=")
|
|
834
|
+
} else if (sValue.indexOf("!=") === 0) {
|
|
836
835
|
sOperator = FilterOperator.NE;
|
|
837
836
|
sParsedValue = sValue.substr(2);
|
|
838
|
-
} else if (sValue.indexOf("<=")
|
|
837
|
+
} else if (sValue.indexOf("<=") === 0) {
|
|
839
838
|
sOperator = FilterOperator.LE;
|
|
840
839
|
sParsedValue = sValue.substr(2);
|
|
841
|
-
} else if (sValue.indexOf("<")
|
|
840
|
+
} else if (sValue.indexOf("<") === 0) {
|
|
842
841
|
sOperator = FilterOperator.LT;
|
|
843
842
|
sParsedValue = sValue.substr(1);
|
|
844
|
-
} else if (sValue.indexOf(">=")
|
|
843
|
+
} else if (sValue.indexOf(">=") === 0) {
|
|
845
844
|
sOperator = FilterOperator.GE;
|
|
846
845
|
sParsedValue = sValue.substr(2);
|
|
847
|
-
} else if (sValue.indexOf(">")
|
|
846
|
+
} else if (sValue.indexOf(">") === 0) {
|
|
848
847
|
sOperator = FilterOperator.GT;
|
|
849
848
|
sParsedValue = sValue.substr(1);
|
|
850
849
|
} else if (aBetween) {
|
|
@@ -859,13 +858,13 @@ sap.ui.define([
|
|
|
859
858
|
sOperator = FilterOperator.LE;
|
|
860
859
|
sParsedValue = aBetween[2];
|
|
861
860
|
}
|
|
862
|
-
} else if (bIsString && sValue.indexOf("*")
|
|
861
|
+
} else if (bIsString && sValue.indexOf("*") === 0 && sValue.lastIndexOf("*") === sValue.length - 1) {
|
|
863
862
|
sOperator = FilterOperator.Contains;
|
|
864
863
|
sParsedValue = sValue.substr(1, sValue.length - 2);
|
|
865
|
-
} else if (bIsString && sValue.indexOf("*")
|
|
864
|
+
} else if (bIsString && sValue.indexOf("*") === 0) {
|
|
866
865
|
sOperator = FilterOperator.EndsWith;
|
|
867
866
|
sParsedValue = sValue.substr(1);
|
|
868
|
-
} else if (bIsString && sValue.lastIndexOf("*")
|
|
867
|
+
} else if (bIsString && sValue.lastIndexOf("*") === sValue.length - 1) {
|
|
869
868
|
sOperator = FilterOperator.StartsWith;
|
|
870
869
|
sParsedValue = sValue.substr(0, sValue.length - 1);
|
|
871
870
|
} else {
|
|
@@ -895,13 +894,13 @@ sap.ui.define([
|
|
|
895
894
|
};
|
|
896
895
|
|
|
897
896
|
Column.prototype.filter = function(sValue) {
|
|
898
|
-
|
|
897
|
+
const oTable = this._getTable();
|
|
899
898
|
|
|
900
899
|
if (!oTable?.getBinding() || this.getFilterProperty() === "") {
|
|
901
900
|
return;
|
|
902
901
|
}
|
|
903
902
|
|
|
904
|
-
|
|
903
|
+
const bExecuteDefault = oTable.fireFilter({
|
|
905
904
|
column: this,
|
|
906
905
|
value: sValue
|
|
907
906
|
});
|
|
@@ -910,16 +909,16 @@ sap.ui.define([
|
|
|
910
909
|
return;
|
|
911
910
|
}
|
|
912
911
|
|
|
913
|
-
|
|
914
|
-
|
|
912
|
+
const aFilters = [];
|
|
913
|
+
const aCols = oTable.getColumns();
|
|
915
914
|
|
|
916
915
|
this.setFiltered(!!sValue);
|
|
917
916
|
this.setFilterValue(sValue);
|
|
918
917
|
|
|
919
|
-
for (
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
918
|
+
for (let i = 0, l = aCols.length; i < l; i++) {
|
|
919
|
+
const oCol = aCols[i];
|
|
920
|
+
let oFilter;
|
|
921
|
+
let sState;
|
|
923
922
|
|
|
924
923
|
try {
|
|
925
924
|
oFilter = oCol._getFilter();
|
|
@@ -927,6 +926,7 @@ sap.ui.define([
|
|
|
927
926
|
} catch (e) {
|
|
928
927
|
sState = ValueState.Error;
|
|
929
928
|
}
|
|
929
|
+
|
|
930
930
|
if (oFilter) {
|
|
931
931
|
aFilters.push(oFilter);
|
|
932
932
|
}
|
|
@@ -941,7 +941,7 @@ sap.ui.define([
|
|
|
941
941
|
};
|
|
942
942
|
|
|
943
943
|
Column.prototype._parseFilterValue = function(sValue) {
|
|
944
|
-
|
|
944
|
+
const oFilterType = this.getFilterType();
|
|
945
945
|
|
|
946
946
|
if (oFilterType) {
|
|
947
947
|
if (typeof oFilterType === "function") {
|
|
@@ -960,7 +960,7 @@ sap.ui.define([
|
|
|
960
960
|
* @protected
|
|
961
961
|
*/
|
|
962
962
|
Column.prototype.shouldRender = function() {
|
|
963
|
-
|
|
963
|
+
let bShouldRender = this.getVisible() && this.getTemplate() != null;
|
|
964
964
|
|
|
965
965
|
/**
|
|
966
966
|
* @deprecated As of Version 1.118
|
|
@@ -971,16 +971,16 @@ sap.ui.define([
|
|
|
971
971
|
};
|
|
972
972
|
|
|
973
973
|
Column.prototype.setProperty = function(sName, vValue) {
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
974
|
+
const oTable = this._getTable();
|
|
975
|
+
const bValueChanged = oTable && this.getProperty(sName) !== vValue;
|
|
976
|
+
const bNeedRowsUpdate = bValueChanged && sName === "visible";
|
|
977
|
+
const bInvalidateFixedColCount = bValueChanged && (sName === "visible" || sName === "headerSpan");
|
|
978
|
+
const vReturn = Element.prototype.setProperty.apply(this, arguments);
|
|
979
979
|
|
|
980
980
|
if (bNeedRowsUpdate) {
|
|
981
981
|
oTable.invalidateRowsAggregation();
|
|
982
982
|
|
|
983
|
-
|
|
983
|
+
const oCreationRow = oTable.getCreationRow();
|
|
984
984
|
if (oCreationRow) {
|
|
985
985
|
oCreationRow._update();
|
|
986
986
|
}
|
|
@@ -1021,13 +1021,13 @@ sap.ui.define([
|
|
|
1021
1021
|
* });
|
|
1022
1022
|
*/
|
|
1023
1023
|
Column.prototype.setFilterType = function(vType) {
|
|
1024
|
-
|
|
1024
|
+
let oType = vType;
|
|
1025
1025
|
if (typeof (vType) === "string") {
|
|
1026
1026
|
try {
|
|
1027
1027
|
// similar to BindingParser allow to specify formatOptions and constraints for types
|
|
1028
|
-
|
|
1028
|
+
const mConfig = JSTokenizer.parseJS(vType);
|
|
1029
1029
|
if (typeof (mConfig.type) === "string") {
|
|
1030
|
-
|
|
1030
|
+
let fnType = sap.ui.require(mConfig.type.replaceAll(".", "/"));
|
|
1031
1031
|
|
|
1032
1032
|
/** @deprecated As of version 1.120 */
|
|
1033
1033
|
if (!fnType) {
|
|
@@ -1037,7 +1037,7 @@ sap.ui.define([
|
|
|
1037
1037
|
oType = fnType && new fnType(mConfig.formatOptions, mConfig.constraints);
|
|
1038
1038
|
}
|
|
1039
1039
|
} catch (ex) {
|
|
1040
|
-
|
|
1040
|
+
let fnType = sap.ui.require(vType.replaceAll(".", "/"));
|
|
1041
1041
|
|
|
1042
1042
|
/** @deprecated As of version 1.120 */
|
|
1043
1043
|
if (!fnType) {
|
|
@@ -1062,7 +1062,7 @@ sap.ui.define([
|
|
|
1062
1062
|
* @returns {int} the column index.
|
|
1063
1063
|
*/
|
|
1064
1064
|
Column.prototype.getIndex = function() {
|
|
1065
|
-
|
|
1065
|
+
const oTable = this._getTable();
|
|
1066
1066
|
if (oTable) {
|
|
1067
1067
|
return oTable.indexOfColumn(this);
|
|
1068
1068
|
} else {
|
|
@@ -1087,14 +1087,14 @@ sap.ui.define([
|
|
|
1087
1087
|
* @private
|
|
1088
1088
|
*/
|
|
1089
1089
|
Column.prototype._getFreeTemplateClone = function(sTemplateType) {
|
|
1090
|
-
|
|
1091
|
-
|
|
1090
|
+
const aTemplateClones = this._mTemplateClones[sTemplateType];
|
|
1091
|
+
let oFreeTemplateClone = null;
|
|
1092
1092
|
|
|
1093
1093
|
if (!aTemplateClones) {
|
|
1094
1094
|
return null;
|
|
1095
1095
|
}
|
|
1096
1096
|
|
|
1097
|
-
for (
|
|
1097
|
+
for (let i = 0; i < aTemplateClones.length; i++) {
|
|
1098
1098
|
if (!aTemplateClones[i] || aTemplateClones[i].bIsDestroyed) {
|
|
1099
1099
|
aTemplateClones.splice(i, 1); // Remove the reference to a destroyed clone.
|
|
1100
1100
|
i--;
|
|
@@ -1120,13 +1120,13 @@ sap.ui.define([
|
|
|
1120
1120
|
return null;
|
|
1121
1121
|
}
|
|
1122
1122
|
|
|
1123
|
-
|
|
1124
|
-
|
|
1123
|
+
const sTemplateType = sPreferredTemplateType == null ? "Standard" : sPreferredTemplateType;
|
|
1124
|
+
let oClone = this._getFreeTemplateClone(sTemplateType);
|
|
1125
1125
|
|
|
1126
1126
|
if (!oClone && TemplateType.hasOwnProperty(sTemplateType)) {
|
|
1127
1127
|
// No free template clone available, create one.
|
|
1128
|
-
|
|
1129
|
-
|
|
1128
|
+
const fnGetTemplate = this["get" + (sTemplateType === "Standard" ? "" : sTemplateType) + "Template"];
|
|
1129
|
+
const oTemplate = fnGetTemplate.call(this);
|
|
1130
1130
|
|
|
1131
1131
|
if (oTemplate) {
|
|
1132
1132
|
oClone = oTemplate.clone();
|
|
@@ -1137,7 +1137,7 @@ sap.ui.define([
|
|
|
1137
1137
|
if (oClone) {
|
|
1138
1138
|
CellMap.set(oClone, this);
|
|
1139
1139
|
|
|
1140
|
-
|
|
1140
|
+
const oTable = this._getTable();
|
|
1141
1141
|
if (oTable) {
|
|
1142
1142
|
oTable._getAccExtension().addColumnHeaderLabel(this, oClone);
|
|
1143
1143
|
}
|
|
@@ -1147,7 +1147,7 @@ sap.ui.define([
|
|
|
1147
1147
|
};
|
|
1148
1148
|
|
|
1149
1149
|
function destroyClones(aClones) {
|
|
1150
|
-
for (
|
|
1150
|
+
for (let i = 0; i < aClones.length; i++) {
|
|
1151
1151
|
if (aClones[i] != null && !aClones[i].bIsDestroyed) {
|
|
1152
1152
|
aClones[i].destroy();
|
|
1153
1153
|
}
|
|
@@ -1162,7 +1162,7 @@ sap.ui.define([
|
|
|
1162
1162
|
*/
|
|
1163
1163
|
Column.prototype._destroyTemplateClones = function(sTemplateType) {
|
|
1164
1164
|
if (sTemplateType == null) {
|
|
1165
|
-
for (
|
|
1165
|
+
for (const sType in TemplateType) {
|
|
1166
1166
|
destroyClones(this._mTemplateClones[sType]);
|
|
1167
1167
|
}
|
|
1168
1168
|
this._initTemplateClonePool();
|
|
@@ -1179,7 +1179,7 @@ sap.ui.define([
|
|
|
1179
1179
|
* @private
|
|
1180
1180
|
*/
|
|
1181
1181
|
Column.prototype._getTable = function() {
|
|
1182
|
-
|
|
1182
|
+
const oParent = this.getParent();
|
|
1183
1183
|
return TableUtils.isA(oParent, "sap.ui.table.Table") ? oParent : null;
|
|
1184
1184
|
};
|
|
1185
1185
|
|