@openui5/sap.ui.table 1.119.1 → 1.120.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/THIRDPARTY.txt +6 -6
- package/package.json +3 -3
- package/src/sap/ui/table/.library +1 -1
- package/src/sap/ui/table/AnalyticalColumn.js +26 -15
- package/src/sap/ui/table/AnalyticalColumnMenu.js +6 -5
- package/src/sap/ui/table/AnalyticalTable.js +25 -38
- package/src/sap/ui/table/Column.js +135 -95
- package/src/sap/ui/table/ColumnMenu.js +1 -1
- package/src/sap/ui/table/CreationRow.js +1 -1
- package/src/sap/ui/table/Row.js +1 -1
- package/src/sap/ui/table/RowAction.js +1 -1
- package/src/sap/ui/table/RowActionItem.js +1 -1
- package/src/sap/ui/table/RowSettings.js +1 -1
- package/src/sap/ui/table/Table.js +200 -185
- package/src/sap/ui/table/TablePersoController.js +1 -1
- package/src/sap/ui/table/TableRenderer.js +35 -11
- package/src/sap/ui/table/TreeTable.js +1 -1
- package/src/sap/ui/table/designtime/Table.designtime.js +21 -2
- package/src/sap/ui/table/extensions/Accessibility.js +18 -8
- package/src/sap/ui/table/extensions/AccessibilityRender.js +1 -1
- package/src/sap/ui/table/extensions/DragAndDrop.js +1 -1
- package/src/sap/ui/table/extensions/ExtensionBase.js +1 -1
- package/src/sap/ui/table/extensions/Keyboard.js +1 -1
- package/src/sap/ui/table/extensions/KeyboardDelegate.js +24 -10
- package/src/sap/ui/table/extensions/Pointer.js +1 -1
- package/src/sap/ui/table/extensions/Scrolling.js +1 -1
- package/src/sap/ui/table/extensions/ScrollingIOS.js +1 -1
- package/src/sap/ui/table/extensions/Synchronization.js +1 -1
- package/src/sap/ui/table/library.js +25 -16
- package/src/sap/ui/table/menus/ColumnHeaderMenuAdapter.js +1 -1
- package/src/sap/ui/table/menus/MobileColumnHeaderMenuAdapter.js +23 -13
- package/src/sap/ui/table/messagebundle_mk.properties +126 -0
- package/src/sap/ui/table/messagebundle_sh.properties +16 -16
- package/src/sap/ui/table/plugins/BindingSelection.js +10 -5
- package/src/sap/ui/table/plugins/MultiSelectionPlugin.js +9 -3
- package/src/sap/ui/table/plugins/ODataV4Selection.js +9 -4
- package/src/sap/ui/table/plugins/PluginBase.js +1 -1
- package/src/sap/ui/table/plugins/SelectionModelSelection.js +10 -5
- package/src/sap/ui/table/plugins/SelectionPlugin.js +17 -3
- package/src/sap/ui/table/plugins/V4Aggregation.js +1 -1
- package/src/sap/ui/table/rowmodes/Auto.js +5 -5
- package/src/sap/ui/table/rowmodes/Fixed.js +5 -5
- package/src/sap/ui/table/rowmodes/Interactive.js +1 -1
- package/src/sap/ui/table/rowmodes/RowMode.js +11 -1
- package/src/sap/ui/table/rowmodes/Variable.js +1 -1
- package/src/sap/ui/table/rules/Plugins.support.js +23 -21
- package/src/sap/ui/table/rules/Rows.support.js +24 -5
- package/src/sap/ui/table/themes/base/Cell.less +1 -1
- package/src/sap/ui/table/themes/base/Grouping.less +1 -1
- package/src/sap/ui/table/themes/base/Table.less +1 -1
- package/src/sap/ui/table/themes/base/library.source.less +0 -3
- package/src/sap/ui/table/themes/sap_hcb/library.source.less +0 -3
- package/src/sap/ui/table/utils/TableUtils.js +10 -12
- package/src/sap/ui/table/utils/_BindingUtils.js +1 -1
- package/src/sap/ui/table/utils/_ColumnUtils.js +1 -1
- package/src/sap/ui/table/utils/_GroupingUtils.js +1 -1
- package/src/sap/ui/table/utils/_HookUtils.js +34 -3
- package/src/sap/ui/table/utils/_MenuUtils.js +1 -1
package/THIRDPARTY.txt
CHANGED
|
@@ -179,7 +179,7 @@ License: Apache-2.0
|
|
|
179
179
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
180
180
|
Contained in: src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js
|
|
181
181
|
|
|
182
|
-
Component: Unicode Common Locale Data Repository, version:
|
|
182
|
+
Component: Unicode Common Locale Data Repository, version: 43
|
|
183
183
|
Copyright: 1991-2014 Unicode, Inc.
|
|
184
184
|
License: Unicode-DFS-2015
|
|
185
185
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Unicode-DFS-2015.txt
|
|
@@ -334,7 +334,7 @@ License: ISC
|
|
|
334
334
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/ISC.txt
|
|
335
335
|
Contained in: src/sap.ui.core/src/sap/ui/core/cache/LRUPersistentCache.js
|
|
336
336
|
|
|
337
|
-
Component: Time Zone Database, version:
|
|
337
|
+
Component: Time Zone Database, version: 2023c
|
|
338
338
|
Copyright: Arthur David Olson, Paul Eggert and other contributors
|
|
339
339
|
License: LicenseRef-tzdata-PublicDomain
|
|
340
340
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/LicenseRef-tzdata-PublicDomain.txt
|
|
@@ -416,7 +416,7 @@ Contained in: src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplore
|
|
|
416
416
|
|
|
417
417
|
Library: sap.ui.webc.common:
|
|
418
418
|
|
|
419
|
-
Component: UI5 Web Components, version: 1.
|
|
419
|
+
Component: UI5 Web Components, version: 1.18.0
|
|
420
420
|
Copyright: SAP
|
|
421
421
|
License: Apache-2.0
|
|
422
422
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
@@ -436,13 +436,13 @@ Contained in: src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/lit-html/
|
|
|
436
436
|
|
|
437
437
|
Library: sap.ui.webc.fiori:
|
|
438
438
|
|
|
439
|
-
Component: UI5 Web Components, version: 1.
|
|
439
|
+
Component: UI5 Web Components, version: 1.18.0
|
|
440
440
|
Copyright: SAP
|
|
441
441
|
License: Apache-2.0
|
|
442
442
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
443
443
|
Contained in: src/sap.ui.webc.fiori/src/sap/ui/webc/fiori/thirdparty/*.*
|
|
444
444
|
|
|
445
|
-
Component: ZXing, version: 0.
|
|
445
|
+
Component: ZXing, version: 0.17.1
|
|
446
446
|
Copyright: 2005 Sun Microsystems, Inc.; 2010-2014 University of Manchester; 2010-2015 Stian Soiland-Reyes; 2015 Peter Hull
|
|
447
447
|
License: Apache-2.0
|
|
448
448
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
@@ -451,7 +451,7 @@ Contained in: src/sap.ui.webc.fiori/src/sap/ui/webc/fiori/lib/zxing.js
|
|
|
451
451
|
|
|
452
452
|
Library: sap.ui.webc.main:
|
|
453
453
|
|
|
454
|
-
Component: UI5 Web Components, version: 1.
|
|
454
|
+
Component: UI5 Web Components, version: 1.18.0
|
|
455
455
|
Copyright: SAP
|
|
456
456
|
License: Apache-2.0
|
|
457
457
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.table",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.120.0",
|
|
4
4
|
"description": "OpenUI5 UI Library sap.ui.table",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/SAP/openui5.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@openui5/sap.ui.core": "1.
|
|
18
|
-
"@openui5/sap.ui.unified": "1.
|
|
17
|
+
"@openui5/sap.ui.core": "1.120.0",
|
|
18
|
+
"@openui5/sap.ui.unified": "1.120.0"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>OpenUI5
|
|
7
7
|
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
8
8
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
|
|
9
|
-
<version>1.
|
|
9
|
+
<version>1.120.0</version>
|
|
10
10
|
|
|
11
11
|
<documentation>Table-like controls, mainly for desktop scenarios.</documentation>
|
|
12
12
|
|
|
@@ -16,19 +16,18 @@ sap.ui.define([
|
|
|
16
16
|
'sap/ui/model/type/Time',
|
|
17
17
|
'./utils/TableUtils',
|
|
18
18
|
"sap/base/Log"
|
|
19
|
-
],
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
) {
|
|
19
|
+
], function(
|
|
20
|
+
Column,
|
|
21
|
+
library,
|
|
22
|
+
Element,
|
|
23
|
+
BooleanType,
|
|
24
|
+
DateTime,
|
|
25
|
+
Float,
|
|
26
|
+
Integer,
|
|
27
|
+
Time,
|
|
28
|
+
TableUtils,
|
|
29
|
+
Log
|
|
30
|
+
) {
|
|
32
31
|
"use strict";
|
|
33
32
|
|
|
34
33
|
var GroupEventType = library.GroupEventType;
|
|
@@ -48,7 +47,7 @@ sap.ui.define([
|
|
|
48
47
|
* @extends sap.ui.table.Column
|
|
49
48
|
*
|
|
50
49
|
* @author SAP SE
|
|
51
|
-
* @version 1.
|
|
50
|
+
* @version 1.120.0
|
|
52
51
|
*
|
|
53
52
|
* @constructor
|
|
54
53
|
* @public
|
|
@@ -125,6 +124,7 @@ sap.ui.define([
|
|
|
125
124
|
var oParent = this.getParent();
|
|
126
125
|
|
|
127
126
|
if (isInstanceOfAnalyticalTable(oParent)) {
|
|
127
|
+
oParent._bContextsAvailable = false;
|
|
128
128
|
if (bGrouped) {
|
|
129
129
|
oParent._addGroupedColumn(this.getId());
|
|
130
130
|
} else {
|
|
@@ -404,9 +404,20 @@ sap.ui.define([
|
|
|
404
404
|
return false;
|
|
405
405
|
};
|
|
406
406
|
|
|
407
|
+
AnalyticalColumn.prototype._isGroupableByMenu = function() {
|
|
408
|
+
return this.isGroupableByMenu();
|
|
409
|
+
};
|
|
410
|
+
|
|
407
411
|
// This column sets its own cell content visibility settings.
|
|
408
412
|
AnalyticalColumn.prototype._setCellContentVisibilitySettings = function() {};
|
|
409
413
|
|
|
410
|
-
|
|
414
|
+
AnalyticalColumn.prototype._applySorters = function() {
|
|
415
|
+
// The analytical info must be updated before sorting via the binding. The request will still be correct, but the binding
|
|
416
|
+
// will create its internal data structure based on the analytical info. We also do not need to get the contexts right
|
|
417
|
+
// now (therefore "true" is passed"), this will be done later in refreshRows.
|
|
418
|
+
this._updateTableAnalyticalInfo(true);
|
|
419
|
+
Column.prototype._applySorters.apply(this, arguments);
|
|
420
|
+
};
|
|
411
421
|
|
|
422
|
+
return AnalyticalColumn;
|
|
412
423
|
});
|
|
@@ -20,7 +20,7 @@ sap.ui.define(['./ColumnMenu', "sap/ui/unified/MenuRenderer", './utils/TableUtil
|
|
|
20
20
|
* @extends sap.ui.table.ColumnMenu
|
|
21
21
|
*
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.120.0
|
|
24
24
|
*
|
|
25
25
|
* @constructor
|
|
26
26
|
* @public
|
|
@@ -63,10 +63,9 @@ sap.ui.define(['./ColumnMenu', "sap/ui/unified/MenuRenderer", './utils/TableUtil
|
|
|
63
63
|
oColumn.getGrouped() ? "accept" : null,
|
|
64
64
|
function(oEvent) {
|
|
65
65
|
var oMenuItem = oEvent.getSource();
|
|
66
|
-
var bGrouped = oColumn.getGrouped();
|
|
66
|
+
var bGrouped = !oColumn.getGrouped();
|
|
67
67
|
|
|
68
|
-
oColumn.
|
|
69
|
-
if (!bGrouped && !oColumn.getShowIfGrouped()) {
|
|
68
|
+
if (bGrouped && !oColumn.getShowIfGrouped()) {
|
|
70
69
|
var oDomRef;
|
|
71
70
|
|
|
72
71
|
if (TableUtils.isNoDataVisible(oTable)) {
|
|
@@ -79,7 +78,9 @@ sap.ui.define(['./ColumnMenu', "sap/ui/unified/MenuRenderer", './utils/TableUtil
|
|
|
79
78
|
oDomRef.focus();
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
|
-
|
|
81
|
+
|
|
82
|
+
oColumn._setGrouped(bGrouped);
|
|
83
|
+
oMenuItem.setIcon(bGrouped ? "sap-icon://accept" : null);
|
|
83
84
|
}
|
|
84
85
|
);
|
|
85
86
|
this.addItem(this._oGroupIcon);
|
|
@@ -13,32 +13,29 @@ sap.ui.define([
|
|
|
13
13
|
"./TableRenderer",
|
|
14
14
|
'./library',
|
|
15
15
|
'sap/ui/model/analytics/ODataModelAdapter',
|
|
16
|
-
'sap/ui/model/Sorter',
|
|
17
16
|
'sap/ui/unified/MenuItem',
|
|
18
17
|
'./utils/TableUtils',
|
|
19
18
|
"./plugins/BindingSelection",
|
|
20
19
|
"sap/base/Log",
|
|
21
|
-
"sap/base/assert",
|
|
22
20
|
"sap/ui/thirdparty/jquery",
|
|
23
|
-
"sap/ui/model/controlhelper/TreeBindingProxy"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
) {
|
|
21
|
+
"sap/ui/model/controlhelper/TreeBindingProxy",
|
|
22
|
+
"sap/ui/core/library"
|
|
23
|
+
], function(
|
|
24
|
+
AnalyticalColumn,
|
|
25
|
+
Column,
|
|
26
|
+
Table,
|
|
27
|
+
TreeTable,
|
|
28
|
+
TableRenderer,
|
|
29
|
+
library,
|
|
30
|
+
ODataModelAdapter,
|
|
31
|
+
MenuItem,
|
|
32
|
+
TableUtils,
|
|
33
|
+
BindingSelectionPlugin,
|
|
34
|
+
Log,
|
|
35
|
+
jQuery,
|
|
36
|
+
TreeBindingProxy,
|
|
37
|
+
CoreLibrary
|
|
38
|
+
) {
|
|
42
39
|
"use strict";
|
|
43
40
|
|
|
44
41
|
var GroupEventType = library.GroupEventType;
|
|
@@ -57,7 +54,7 @@ sap.ui.define([
|
|
|
57
54
|
* @see https://github.com/SAP/odata-vocabularies/blob/main/docs/v2-annotations.md
|
|
58
55
|
*
|
|
59
56
|
* @extends sap.ui.table.Table
|
|
60
|
-
* @version 1.
|
|
57
|
+
* @version 1.120.0
|
|
61
58
|
*
|
|
62
59
|
* @constructor
|
|
63
60
|
* @public
|
|
@@ -422,8 +419,6 @@ sap.ui.define([
|
|
|
422
419
|
visible: oColumn.getVisible(),
|
|
423
420
|
grouped: oColumn.getGrouped(),
|
|
424
421
|
total: oColumn.getSummed(),
|
|
425
|
-
sorted: oColumn.getSorted(),
|
|
426
|
-
sortOrder: oColumn.getSortOrder(),
|
|
427
422
|
inResult: oColumn.getInResult(),
|
|
428
423
|
formatter: oColumn.getGroupHeaderFormatter()
|
|
429
424
|
});
|
|
@@ -445,8 +440,6 @@ sap.ui.define([
|
|
|
445
440
|
visible: oColumn.getVisible(),
|
|
446
441
|
grouped: oColumn.getGrouped(),
|
|
447
442
|
total: oColumn.getSummed(),
|
|
448
|
-
sorted: oColumn.getSorted(),
|
|
449
|
-
sortOrder: oColumn.getSortOrder(),
|
|
450
443
|
inResult: oColumn.getInResult(),
|
|
451
444
|
formatter: oColumn.getGroupHeaderFormatter()
|
|
452
445
|
});
|
|
@@ -655,12 +648,7 @@ sap.ui.define([
|
|
|
655
648
|
this._mGroupHeaderMenuItems["sortasc"] = new MenuItem({
|
|
656
649
|
text: TableUtils.getResourceText("TBL_SORT_ASC"),
|
|
657
650
|
select: function() {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
if (oGroupColumnInfo) {
|
|
661
|
-
var oColumn = oGroupColumnInfo.column;
|
|
662
|
-
oColumn._sort(false); //update Analytical Info triggered by aftersort in column
|
|
663
|
-
}
|
|
651
|
+
getGroupColumnInfo()?.column._sort(CoreLibrary.SortOrder.Ascending);
|
|
664
652
|
},
|
|
665
653
|
icon: "sap-icon://up"
|
|
666
654
|
});
|
|
@@ -671,12 +659,7 @@ sap.ui.define([
|
|
|
671
659
|
this._mGroupHeaderMenuItems["sortdesc"] = new MenuItem({
|
|
672
660
|
text: TableUtils.getResourceText("TBL_SORT_DESC"),
|
|
673
661
|
select: function() {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
if (oGroupColumnInfo) {
|
|
677
|
-
var oColumn = oGroupColumnInfo.column;
|
|
678
|
-
oColumn._sort(true); //update Analytical Info triggered by aftersort in column
|
|
679
|
-
}
|
|
662
|
+
getGroupColumnInfo()?.column._sort(CoreLibrary.SortOrder.Descending);
|
|
680
663
|
},
|
|
681
664
|
icon: "sap-icon://down"
|
|
682
665
|
});
|
|
@@ -1059,6 +1042,10 @@ sap.ui.define([
|
|
|
1059
1042
|
return 0;
|
|
1060
1043
|
};
|
|
1061
1044
|
|
|
1045
|
+
/**
|
|
1046
|
+
* @deprecated As of version 1.115
|
|
1047
|
+
* @private
|
|
1048
|
+
*/
|
|
1062
1049
|
AnalyticalTable.prototype._onPersoApplied = function() {
|
|
1063
1050
|
Table.prototype._onPersoApplied.apply(this, arguments);
|
|
1064
1051
|
this._aGroupedColumns = [];
|
|
@@ -8,10 +8,8 @@
|
|
|
8
8
|
sap.ui.define([
|
|
9
9
|
"./utils/TableUtils",
|
|
10
10
|
"./menus/ColumnHeaderMenuAdapter",
|
|
11
|
-
"./library",
|
|
12
11
|
"sap/ui/core/Core",
|
|
13
12
|
"sap/ui/core/Element",
|
|
14
|
-
"sap/ui/core/Popup",
|
|
15
13
|
"sap/ui/core/library",
|
|
16
14
|
"sap/ui/model/Filter",
|
|
17
15
|
"sap/ui/model/FilterOperator",
|
|
@@ -19,39 +17,34 @@ sap.ui.define([
|
|
|
19
17
|
"sap/ui/model/Sorter",
|
|
20
18
|
"sap/ui/model/Type",
|
|
21
19
|
"sap/ui/model/type/String",
|
|
22
|
-
"sap/base/util/ObjectPath",
|
|
20
|
+
"sap/base/util/ObjectPath", // TODO: Remove in UI5 2.0
|
|
23
21
|
"sap/base/util/JSTokenizer",
|
|
24
22
|
"sap/base/Log"
|
|
25
23
|
], function(
|
|
26
24
|
TableUtils,
|
|
27
25
|
ColumnHeaderMenuAdapter,
|
|
28
|
-
library,
|
|
29
26
|
Core,
|
|
30
27
|
Element,
|
|
31
|
-
|
|
32
|
-
coreLibrary,
|
|
28
|
+
CoreLibrary,
|
|
33
29
|
Filter,
|
|
34
30
|
FilterOperator,
|
|
35
31
|
FilterType,
|
|
36
32
|
Sorter,
|
|
37
33
|
Type,
|
|
38
34
|
StringType,
|
|
39
|
-
ObjectPath,
|
|
35
|
+
ObjectPath, // TODO: Remove in UI5 2.0
|
|
40
36
|
JSTokenizer,
|
|
41
37
|
Log
|
|
42
38
|
) {
|
|
43
39
|
"use strict";
|
|
44
40
|
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
ValueState = coreLibrary.ValueState;
|
|
49
|
-
|
|
41
|
+
var HorizontalAlign = CoreLibrary.HorizontalAlign;
|
|
42
|
+
var SortOrder = CoreLibrary.SortOrder;
|
|
43
|
+
var ValueState = CoreLibrary.ValueState;
|
|
50
44
|
var TemplateType = {
|
|
51
45
|
Standard: "Standard",
|
|
52
46
|
Creation: "Creation"
|
|
53
47
|
};
|
|
54
|
-
|
|
55
48
|
var _private = TableUtils.createWeakMapFacade();
|
|
56
49
|
|
|
57
50
|
/**
|
|
@@ -70,7 +63,7 @@ sap.ui.define([
|
|
|
70
63
|
* @class
|
|
71
64
|
* The column allows you to define column specific properties that will be applied when rendering the table.
|
|
72
65
|
* @extends sap.ui.core.Element
|
|
73
|
-
* @version 1.
|
|
66
|
+
* @version 1.120.0
|
|
74
67
|
*
|
|
75
68
|
* @constructor
|
|
76
69
|
* @public
|
|
@@ -127,15 +120,20 @@ sap.ui.define([
|
|
|
127
120
|
/**
|
|
128
121
|
* Indicates if the column is sorted. This property only controls if a sort indicator is displayed in the
|
|
129
122
|
* column header - it does not trigger the sort function. The column can be sorted using {@link sap.ui.table.Table#sort}.
|
|
123
|
+
*
|
|
124
|
+
* If this property is set to <code>true</code> and the <code>sortOrder</code> property is <code>None</code>, <code>sortOrder</code> is
|
|
125
|
+
* automatically set to <code>Ascending</code>.
|
|
126
|
+
* If this property is <code>true</code> and <code>sortOrder</code> is <code>None</code>, the sort indicator is not shown.
|
|
127
|
+
*
|
|
128
|
+
* @deprecated As of version 1.120, replaced by {@link sap.ui.core.SortOrder SortOrder.None} for the <code>sortOrder</code> property
|
|
130
129
|
*/
|
|
131
|
-
sorted: {type: "boolean", group: "Appearance", defaultValue: false},
|
|
130
|
+
sorted: {type: "boolean", group: "Appearance", defaultValue: false, deprecated: true},
|
|
132
131
|
|
|
133
132
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* @see sap.ui.table.SortOrder (default value: "Ascending")
|
|
133
|
+
* Controls whether a sort indicator is displayed in the column header.
|
|
134
|
+
* <b>Note:</b> Setting this property does not sort the table. The column can be sorted using {@link sap.ui.table.Table#sort}.
|
|
137
135
|
*/
|
|
138
|
-
sortOrder: {type: "sap.ui.
|
|
136
|
+
sortOrder: {type: "sap.ui.core.SortOrder", group: "Appearance", defaultValue: SortOrder.None},
|
|
139
137
|
|
|
140
138
|
/**
|
|
141
139
|
* Specifies the binding property on which the column will sort.
|
|
@@ -210,6 +208,10 @@ sap.ui.define([
|
|
|
210
208
|
* As an alternative, a function can be passed that takes over the conversion. This cannot be done in the
|
|
211
209
|
* XMLView, use {@link #setFilterType} instead.
|
|
212
210
|
*
|
|
211
|
+
* <b>Note:</b> The usage of string-based type definitions without explicitly loading these types (<code>sap.ui.require</code>)
|
|
212
|
+
* in the controller has been deprecated and might no longer work in future releases.
|
|
213
|
+
* Please ensure that the types are requested correctly before setting this property.
|
|
214
|
+
*
|
|
213
215
|
* @since 1.9.2
|
|
214
216
|
*/
|
|
215
217
|
filterType: {type: "any", group: "Misc", defaultValue: null},
|
|
@@ -645,24 +647,33 @@ sap.ui.define([
|
|
|
645
647
|
* @returns {boolean}
|
|
646
648
|
*/
|
|
647
649
|
Column.prototype.isGroupableByMenu = function() {
|
|
648
|
-
var oTable = this.
|
|
650
|
+
var oTable = this._getTable();
|
|
649
651
|
return !!(oTable && oTable.getEnableGrouping && oTable.getEnableGrouping() && this.getSortProperty());
|
|
650
652
|
};
|
|
651
653
|
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
654
|
+
Column.prototype._isGroupableByMenu = function() {
|
|
655
|
+
var bIsGroupableByMenu = false;
|
|
656
|
+
/**
|
|
657
|
+
* @deprecated As of version 1.119.
|
|
658
|
+
*/
|
|
659
|
+
bIsGroupableByMenu = this.isGroupableByMenu();
|
|
660
|
+
|
|
661
|
+
return bIsGroupableByMenu;
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
Column.prototype.setSorted = function(bSorted) {
|
|
665
|
+
this.setProperty("sorted", bSorted, true);
|
|
666
|
+
|
|
667
|
+
if (bSorted && this.getSortOrder() === SortOrder.None) {
|
|
668
|
+
this.setSortOrder(SortOrder.Ascending); // "Ascending" was the default value of "sortOrder" before "sorted" was deprecated.
|
|
669
|
+
}
|
|
670
|
+
|
|
657
671
|
this._updateIcons();
|
|
658
672
|
return this;
|
|
659
673
|
};
|
|
660
674
|
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
*/
|
|
664
|
-
Column.prototype.setSortOrder = function(tSortOrder) {
|
|
665
|
-
this.setProperty("sortOrder", tSortOrder, true);
|
|
675
|
+
Column.prototype.setSortOrder = function(sSortOrder) {
|
|
676
|
+
this.setProperty("sortOrder", sSortOrder, true);
|
|
666
677
|
this._updateIcons();
|
|
667
678
|
return this;
|
|
668
679
|
};
|
|
@@ -737,95 +748,106 @@ sap.ui.define([
|
|
|
737
748
|
* @deprecated Since version 1.5.1. Please use the function "sap.ui.Table.prototype.sort".
|
|
738
749
|
*/
|
|
739
750
|
Column.prototype.sort = function(bDescending, bAdd) {
|
|
740
|
-
|
|
751
|
+
this._sort(bDescending ? SortOrder.Descending : SortOrder.Ascending, bAdd);
|
|
752
|
+
return this;
|
|
741
753
|
};
|
|
742
754
|
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
column: this,
|
|
754
|
-
sortOrder: sNewSortOrder,
|
|
755
|
-
columnAdded: bAdd
|
|
756
|
-
});
|
|
757
|
-
|
|
758
|
-
if (bExecuteDefault) {
|
|
759
|
-
// update properties of current column
|
|
760
|
-
this.setProperty("sorted", true, true);
|
|
761
|
-
this.setProperty("sortOrder", sNewSortOrder, true);
|
|
762
|
-
_private(this).oSorter = new Sorter(this.getSortProperty(), this.getSortOrder() === SortOrder.Descending);
|
|
755
|
+
/**
|
|
756
|
+
* Changes the sort order of this column. Sorts the binding and updates properties.
|
|
757
|
+
*
|
|
758
|
+
* @param {sap.ui.core.SortOrder} sSortOrder The new sort order
|
|
759
|
+
* @param {boolean} [bAdd=false]
|
|
760
|
+
* Determines whether to append this column to the list of sorted columns. By default, previously sorted columns are unsorted. This parameter
|
|
761
|
+
* has no effect if the column is unsorted.
|
|
762
|
+
*/
|
|
763
|
+
Column.prototype._sort = function(sSortOrder, bAdd) {
|
|
764
|
+
var oTable = this._getTable();
|
|
763
765
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
+
if (!oTable) {
|
|
767
|
+
return;
|
|
766
768
|
}
|
|
767
|
-
return this;
|
|
768
|
-
};
|
|
769
769
|
|
|
770
|
-
|
|
771
|
-
var oTable = this.getParent();
|
|
772
|
-
if (oTable) {
|
|
773
|
-
// add current column to list of sorted columns
|
|
770
|
+
if (sSortOrder === SortOrder.None) {
|
|
774
771
|
oTable._removeSortedColumn(this);
|
|
772
|
+
} else {
|
|
773
|
+
oTable.pushSortedColumn(this, bAdd);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
var bExecuteDefault = oTable.fireSort({
|
|
777
|
+
column: this,
|
|
778
|
+
sortOrder: sSortOrder,
|
|
779
|
+
columnAdded: sSortOrder !== SortOrder.None && bAdd === true
|
|
780
|
+
});
|
|
775
781
|
|
|
776
|
-
|
|
782
|
+
if (!bExecuteDefault) {
|
|
783
|
+
return;
|
|
777
784
|
}
|
|
778
|
-
|
|
785
|
+
|
|
786
|
+
/** @deprecated As of version 1.120 */
|
|
787
|
+
this.setProperty("sorted", sSortOrder !== SortOrder.None, true);
|
|
788
|
+
this.setProperty("sortOrder", sSortOrder, true);
|
|
789
|
+
this._updateSorters();
|
|
779
790
|
};
|
|
780
791
|
|
|
781
|
-
Column.prototype.
|
|
782
|
-
var oTable = this.
|
|
783
|
-
var
|
|
792
|
+
Column.prototype._updateSorters = function() {
|
|
793
|
+
var oTable = this._getTable();
|
|
794
|
+
var aSortedColumns = oTable.getSortedColumns();
|
|
784
795
|
var aColumns = oTable.getColumns();
|
|
796
|
+
var sSortOrder = this.getSortOrder();
|
|
785
797
|
|
|
786
|
-
//
|
|
787
|
-
for (
|
|
788
|
-
if (
|
|
789
|
-
//
|
|
798
|
+
// Reset the sorting status of all columns which are not sorted anymore.
|
|
799
|
+
for (let i = 0, l = aColumns.length; i < l; i++) {
|
|
800
|
+
if (aSortedColumns.indexOf(aColumns[i]) < 0) {
|
|
801
|
+
// Column is not sorted anymore. Reset to default and remove sorter.
|
|
802
|
+
/** @deprecated As of version 1.120 */
|
|
790
803
|
aColumns[i].setProperty("sorted", false, true);
|
|
791
|
-
aColumns[i].setProperty("sortOrder", SortOrder.
|
|
804
|
+
aColumns[i].setProperty("sortOrder", SortOrder.None, true);
|
|
792
805
|
aColumns[i]._updateIcons(true);
|
|
793
806
|
delete _private(aColumns[i]).oSorter;
|
|
794
807
|
}
|
|
795
808
|
}
|
|
796
809
|
|
|
797
|
-
//
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
810
|
+
// Update the sorter of this column. If the sorter needs to be removed, this was already done above.
|
|
811
|
+
if (sSortOrder !== SortOrder.None) {
|
|
812
|
+
_private(this).oSorter = new Sorter(this.getSortProperty(), sSortOrder === SortOrder.Descending);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
// Make sure sorted columns show the sort icon.
|
|
816
|
+
for (let i = 0, l = aSortedColumns.length; i < l; i++) {
|
|
817
|
+
aSortedColumns[i]._updateIcons(true);
|
|
802
818
|
}
|
|
803
819
|
|
|
804
820
|
oTable._resetColumnHeaderHeights();
|
|
805
821
|
oTable._updateRowHeights(oTable._collectRowHeights(true), true);
|
|
822
|
+
this._applySorters();
|
|
823
|
+
};
|
|
806
824
|
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
if (this._updateTableAnalyticalInfo) {
|
|
811
|
-
// The analytical info must be updated before sorting via the binding. The request will still be correct, but the binding
|
|
812
|
-
// will create its internal data structure based on the analytical info. We also do not need to get the contexts right
|
|
813
|
-
// now (therefore "true" is passed"), this will be done later in refreshRows.
|
|
814
|
-
this._updateTableAnalyticalInfo(true);
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
// sort the binding
|
|
818
|
-
oBinding.sort(aSorters);
|
|
825
|
+
Column.prototype._applySorters = function() {
|
|
826
|
+
const oTable = this._getTable();
|
|
827
|
+
const oBinding = oTable.getBinding();
|
|
819
828
|
|
|
820
|
-
|
|
829
|
+
if (!oBinding) {
|
|
821
830
|
Log.warning("Sorting not performed because no binding present", this);
|
|
831
|
+
return;
|
|
822
832
|
}
|
|
833
|
+
|
|
834
|
+
const aSortedColumns = oTable.getSortedColumns();
|
|
835
|
+
const aSorters = aSortedColumns.map((oSortedColumn) => {
|
|
836
|
+
return _private(oSortedColumn).oSorter;
|
|
837
|
+
});
|
|
838
|
+
|
|
839
|
+
oBinding.sort(aSorters);
|
|
823
840
|
};
|
|
824
841
|
|
|
825
842
|
Column.prototype._updateIcons = function(bSkipUpdateRowHeights) {
|
|
826
|
-
var oTable = this.
|
|
827
|
-
|
|
828
|
-
|
|
843
|
+
var oTable = this._getTable();
|
|
844
|
+
var bSorted = this.getSortOrder() !== SortOrder.None;
|
|
845
|
+
var bFiltered = this.getFiltered();
|
|
846
|
+
|
|
847
|
+
/** @deprecated As of version 1.120 */
|
|
848
|
+
if (!this.getSorted()) {
|
|
849
|
+
bSorted = false;
|
|
850
|
+
}
|
|
829
851
|
|
|
830
852
|
if (!oTable || !oTable.getDomRef()) {
|
|
831
853
|
return;
|
|
@@ -945,7 +967,7 @@ sap.ui.define([
|
|
|
945
967
|
};
|
|
946
968
|
|
|
947
969
|
Column.prototype.filter = function(sValue) {
|
|
948
|
-
var oTable = this.
|
|
970
|
+
var oTable = this._getTable();
|
|
949
971
|
|
|
950
972
|
if (oTable && oTable.isBound("rows")) {
|
|
951
973
|
|
|
@@ -1055,8 +1077,14 @@ sap.ui.define([
|
|
|
1055
1077
|
* @public
|
|
1056
1078
|
*
|
|
1057
1079
|
* @example <caption>Class name of a type.</caption>
|
|
1080
|
+
* // The usage of string-based type definitions without explicitly loading these types (<code>sap.ui.require</code>) in the controller has been deprecated and might no longer work in future releases.
|
|
1081
|
+
* // Please ensure that the types are requested correctly before setting this property.
|
|
1058
1082
|
* oColumn.setFilterType("sap.ui.model.type.Date");
|
|
1059
1083
|
*
|
|
1084
|
+
* @example <caption>Module path of a type.</caption>
|
|
1085
|
+
* // The type needs to be loaded in advance by the application.
|
|
1086
|
+
* oColumn.setFilterType("sap/ui/model/type/Date");
|
|
1087
|
+
*
|
|
1060
1088
|
* @example <caption>Binding expression similar to the binding syntax.</caption>
|
|
1061
1089
|
* // The escaping is mandatory to avoid handling by the binding parser.
|
|
1062
1090
|
* oColumn.setFilterType("\{type: 'sap.ui.model.type.Date', formatOptions: \{UTC: true\}, constraints: \{\} \}");
|
|
@@ -1074,11 +1102,23 @@ sap.ui.define([
|
|
|
1074
1102
|
// similar to BindingParser allow to specify formatOptions and constraints for types
|
|
1075
1103
|
var mConfig = JSTokenizer.parseJS(vType);
|
|
1076
1104
|
if (typeof (mConfig.type) === "string") {
|
|
1077
|
-
var fnType =
|
|
1105
|
+
var fnType = sap.ui.require(mConfig.type.replaceAll(".", "/"));
|
|
1106
|
+
|
|
1107
|
+
/** @deprecated As of version 1.120 */
|
|
1108
|
+
if (!fnType) {
|
|
1109
|
+
fnType = ObjectPath.get(vType);
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1078
1112
|
oType = fnType && new fnType(mConfig.formatOptions, mConfig.constraints);
|
|
1079
1113
|
}
|
|
1080
1114
|
} catch (ex) {
|
|
1081
|
-
var fnType =
|
|
1115
|
+
var fnType = sap.ui.require(vType.replaceAll(".", "/"));
|
|
1116
|
+
|
|
1117
|
+
/** @deprecated As of version 1.120 */
|
|
1118
|
+
if (!fnType) {
|
|
1119
|
+
fnType = ObjectPath.get(vType);
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1082
1122
|
oType = fnType && new fnType();
|
|
1083
1123
|
}
|
|
1084
1124
|
// check for a valid type
|
|
@@ -1097,7 +1137,7 @@ sap.ui.define([
|
|
|
1097
1137
|
* @returns {int} the column index.
|
|
1098
1138
|
*/
|
|
1099
1139
|
Column.prototype.getIndex = function() {
|
|
1100
|
-
var oTable = this.
|
|
1140
|
+
var oTable = this._getTable();
|
|
1101
1141
|
if (oTable) {
|
|
1102
1142
|
return oTable.indexOfColumn(this);
|
|
1103
1143
|
} else {
|
|
@@ -1172,7 +1212,7 @@ sap.ui.define([
|
|
|
1172
1212
|
if (oClone) {
|
|
1173
1213
|
CellMap.set(oClone, this);
|
|
1174
1214
|
|
|
1175
|
-
var oTable = this.
|
|
1215
|
+
var oTable = this._getTable();
|
|
1176
1216
|
if (oTable) {
|
|
1177
1217
|
oTable._getAccExtension().addColumnHeaderLabel(this, oClone);
|
|
1178
1218
|
}
|