Newer Version Available
setPanelHeight() for Lightning Experience
Sets a utility panel’s height.
Arguments
| Name | Type | Description |
|---|---|---|
| utilityId | string | The ID of the utility of which to set the height. Optional when called within a utility. |
| heightPX | integer | The height of the utility panel in pixels. |
Sample Code
This component, when added to a single-column Lightning page used in a utility bar, sets the height of the utility to 500 pixels when the button is pressed.
Component code:
1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2 <lightning:utilityBarAPI aura:id="utilitybar" />
3 <lightning:button label="Set Panel Height" onclick="{! c.setPanelHeight }" />
4</aura:component>Controller code:
1({
2 setPanelHeight : function(component, event, helper) {
3 var utilityAPI = component.find("utilitybar");
4 utilityAPI.setPanelHeight({
5 heightPX: 500
6 });
7 }
8})Response
This method returns a promise that, upon success, resolves to true.