Skip to Content

sap ui5 table personalization and grouping issue

Hello Experts,

I have a problem with table(sap.ui.table.Table), personalization(sap.ui.table.TablePersoController) and column grouping.

Steps to replicate:

1. table is loaded with data.

2. I enable grouping for a column(Serial No.) and save personalization.

3. Refresh the browser.

Expected Result:

I expect the browser to remember my column settings including the grouping, the same way when it was closed.

Actual Result:

Browser remembers everything except grouping, moreover the column Serial No. is not visible until I clear the personalization.

Remarks:

Library version 1.46.10. However, I am getting this issue in almost all versions.

Code:

Table -

var oSDASHM2EDIDETTableEDIDET = new sap.ui.table.Table("idSDASHM2EDIDETTableEDIDET",{
    		//visibleRowCount: 15,
            //firstVisibleRow: 3,
            //fixedColumnCount: 3,
            //columnHeaderHeight: 30,
            width: '98%',
            enableGrouping : true,
            showColumnVisibilityMenu : true,
            //enableColumnReordering : true,
            selectionMode: sap.ui.table.SelectionMode.None,
            toolbar: new sap.ui.commons.Toolbar({
				items: [
					
					new sap.ui.commons.Button("idBUYERDMSTablePoPersonal", {
						icon: "sap-icon://action-settings",
						visible : false,
					}),




					new sap.ui.commons.Button({
						text: "Clear and Refresh",
						icon: "sap-icon://refresh",
						press: function(oEvent) {
							oPersoService.delPersData();
							oTPC.refresh().done(function() {
								sap.ui.commons.MessageBox.alert("Done!", "INFORMATION", "Refresh");
							});
						}
					}),
					new sap.ui.commons.Button({
						text: "Save",
						icon: "sap-icon://save",
						press: function(oEvent) {
							oTPC.savePersonalizations().done(function() {
								sap.ui.commons.MessageBox.alert("Done!", "INFORMATION", "Save");
							});
						}
					})
				],
				rightItems: [
					/*new sap.ui.commons.ToggleButton({
						text: "AutoSave",
						icon: "sap-icon://save",
						pressed: true,
						press: function(oEvent) {
							oTPC.setAutoSave(this.getPressed());
						}
					})*/
				]
			}),
            /*toolbar: new sap.m.Toolbar({
    			content: [
    				new sap.m.Button("idBUYERDMSTablePoPersonal", {
    					icon: "sap-icon://action-settings"
    				})
    			]
    		}),*/
            //navigationMode: sap.ui.table.NavigationMode.Paginator
    	 }).addStyleClass("tblBorder");
... columns go here normally

Personliaztion -

var oPersoService = {


			getPersData: function() {
				var oDeferred = jQuery.Deferred();
				var sJSON = window.localStorage.getItem("oSDASHM2EDIDETTableEDIDETPersonal") || "{}";
				printPersoData(sJSON);
				var oBundle = JSON.parse(sJSON);
				oDeferred.resolve(oBundle);
				return oDeferred.promise();
			},


			setPersData: function(oBundle) {
				var oDeferred = jQuery.Deferred();
				var sJSON = JSON.stringify(oBundle, null, 4);
				window.localStorage.setItem("oSDASHM2EDIDETTableEDIDETPersonal", sJSON);
				printPersoData(sJSON);
				oDeferred.resolve();
				return oDeferred.promise();
			},


			delPersData: function() {
				var oDeferred = jQuery.Deferred();
				window.localStorage.removeItem("oSDASHM2EDIDETTableEDIDETPersonal");
				printPersoData("");
				oDeferred.resolve();
				return oDeferred.promise();
			}


		};
		
		jQuery.sap.require("sap.ui.table.TablePersoController");
		var oTPC = new sap.ui.table.TablePersoController("idTPC", {
			table: oSDASHM2EDIDETTableEDIDET,
			persoService: oPersoService,
			hasGrouping: true
		});

Thank you,

Seyed Ismail.

pers-1.png (27.9 kB)
pers-2.png (21.8 kB)
pers-3.png (23.0 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers