cancel
Showing results for 
Search instead for 
Did you mean: 

Is there some sort of layout resize manager for the SAPUI5?

Former Member
0 Kudos

I know there is the hidden and private sap.ui.core.ResizeHandler but it looks like a naive implementation.

1. The Charts are fixed after rendering.

2. Notification Widget has it's own resizing attached to the dom and it's not even being throttled

Offensive Code Below:

//Snippet From sap.ui.ux3.NotificationBar-dbg.js

sap.ui.ux3.NotificationBar.prototype.init = function() {

...

    jQuery(window).unbind("resize", fnOnResize);

}

Accepted Solutions (1)

Accepted Solutions (1)

AndreasKunz
Advisor
Advisor
0 Kudos

Hi Jeffrey,

most browsers only fire "resize" for the entire window, not for individual DOM elements. But sometimes elements resize without the window being resized and you need to know that.

For this case the "naive implementation" which repeatedly checks element sizes seems to be the standard solution.

You are right that reaction to the "resize" event of the window should better be throttled.

The "afterRendering" adaptions are of slightly different nature: as rendering means the creation of an HTML string without knowing the location in the page and the available space, some things need to be done once size and dimensions of the control are known.

Regards

Andreas

Former Member
0 Kudos

The idea is that you have the notion of a parent-child relationship.  There are various container like classes (HorizontalLayout, VerticalLayout, MatrixLayout) that could propagate resize events without everything querying the dom or having to attach listeners to specific dom elements.

Also, one thing to consider is leveraging documentFragments to improve browser rendering time.

http://jsperf.com/doc-fragment

Sizing in afterRendering calls is likely to trigger reflows that could have been avoided.

Answers (0)