Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3548

sap.ui.table Scrolling Performance

$
0
0

Hi,

 

I've been struggling with jittery scrolling when using a Custom Control for the table's column template.

 

I  replaced the following code:

table.bindAggregation("columns", "/columns", function(sId, oContext){    return new sap.ui.table.Column({         label: "{heading}",         template: new sap.m.Label({              text: {path: oContext.getProperty("heading") + "/value"}         }),    });
});

with:

table.bindAggregation("columns", "/columns", function(sId, oContext){    return new sap.ui.table.Column({         label: "{heading}",         template:new customLabel({              text: {path: oContext.getProperty("heading") + "/value"}         }),    });
});

(notice line 5 now creates an instance of my custom control)



Unfortunately this dramatically reduced the performance of the table when scrolling. It was lagging and jumping around instead of having a smooth scrolling experience. At first I though my custom control is to complex, but I took everything out and simplified it to only the following code, yet it still gave the bad performance:

 

initCustomLabel = function(){       sap.ui.core.Control.extend("customLabel",       {            metadata:            {                 properties:                 {                      text:                      {                           type: "string"                      }                 },            aggregations: {                 "_Label":{                      type: "sap.m.Label",                      multiple: false,                      visibility: "hidden"                 }            }       },       init: function()       {            var label = new sap.m.Label();            this.setAggregation("_Label", label);       },       renderer: function(oRm, oControl)       {            oRm.write("<div");            oRm.writeControlData(oControl);            oRm.addStyle("display", "inline-flex");            oRm.writeClasses();            oRm.writeStyles();            oRm.write(">");            var label = oControl.getAggregation("_Label");            label.setText(oControl.getText());            oRm.renderControl(label);            oRm.write("</div>");       }  });
};

 

I've created two jsbins to demonstrate the problem:

     Fast Normal Scrolling: JS Bin - Collaborative JavaScript Debugging

    

     Slow Jittery Scrolling: JS Bin - Collaborative JavaScript Debugging

 

 

The jsbin files only show a slightly worse scrolling performance, but with my actual data, which is more complex, the scrolling makes the table unusable. Any help would be much appreciated.

 

Regrads


Viewing all articles
Browse latest Browse all 3548

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>