Interface for controls which can have special behavior inside sap.m.OverflowToolbar
. Controls that implement this interface must provide a getOverflowToolbarConfig
method that accepts no arguments and returns an object with the following fields:
canOverflow
- A boolean that tells whether the control can move to the overflow menu or not.Note: Even if canOverflow
is set to false
, the propsUnrelatedToSize
field is taken into account, allowing to optimize the behavior of controls that do not need to overflow, but are used in an sap.m.OverflowToolbar
regardless.
autoCloseEvents
- An array of strings, listing all of the control's events that should trigger the closing of the overflow menu, when fired.invalidationEvents
- An array of strings, listing all of the control's events that should trigger the invalidation of the sap.m.OverflowToolbar
, when fired.propsUnrelatedToSize
- An array of strings, listing all of the control's properties that, when changed, should not cause the overflow toolbar to invalidate.Note: By default sap.m.OverflowToolbar
invalidates whenever any property of a child control changes. This is to ensure that whenever the size of a child control changes, the overflow toolbar's layout is recalculated. Some properties however do not affect control size, making it unnecessary to invalidate the overflow toolbar when they change. You can list them here for optimization purposes.
onBeforeEnterOverflow(oControl)
- A callback function that will be invoked before moving the control into the overflow menu. The control instance will be passed as an argument.Note: The context of the function is not the control instance (use the oControl
parameter for this purpose), but rather an internal helper object, associated with the current sap.m.OverflowToolbar
instance. This object only needs to be manipulated in special cases (e.g. when you want to store state on it, rather than on the control instance).
onAfterExitOverflow(oControl)
- A callback function that will be invoked after taking the control out of the overflow menu (before moving it back to the toolbar itself). The control instance will be passed as an argument.Note: See: onBeforeEnterOverflow
for details about the function's context.
getCustomImportance()
- A function that, if provided, will be called to determine the priority of the control. This function must return a value of type sap.m.OverflowToolbarPriority
. The string "Medium" is also accepted and interpreted as priority between Low
and High
.Note: Normally priority in sap.m.OverflowToolbar
is managed with the priority
property of sap.m.OverflowToolbarLayoutData
. However, some controls may have other means of defining priority, such as dedicated properties or other types of layout data for that purpose. In summary, implementing this function allows a control to override the default priority logic (sap.m.OverflowToolbarLayoutData
) by providing its own.
Important: In addition, the control can implement a CSS class, scoped with the .sapMOverflowToolbarMenu-CTX
context selector, that will be applied whenever the control is inside the overflow menu. For example, to make your control take up the whole width of the overflow menu, you can add a context class to your control's base CSS file like this:
.sapMOverflowToolbarMenu-CTX .sapMyControlClass { width: 100%; }
Event | Description |
---|