You need to sign in to do that
Don't have an account?
Andrew Aldis 15
lighting component with a sticky header/footer
Is there a way to create a lightning component with a static header and footer that stay at the top even when the user is scrolling. I need it to work in mobile more that desktop. If not are there any work arounds?
I don't think there is an SLDS class specifically that enables scrolling, however an easy way to enable this using standard CSS is to do the following: There is now a standard utility class for making a div scrollable. The documentation can be found here:
- http://https:/www.lightningdesignsystem.com/components/utilities/scrollable/#overview
The code would now be as follows. For more information please refer to below link.- https://salesforce.stackexchange.com/questions/183660/slds-table-with-fixed-header
Hope this helps.Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra
If we customize the whole dialog we can put sticky header and footer and also the contet can be scrollable.
Please refer to this website : Custom Quick Action with sticky header and footer (http://www.sfdcbox.com/2018/07/customize-width-header-and-footer-for.html)
It worked for me .
Thanks
Srinivas
In my case, I had an aura component button that calls a lightning:flow (screen flow) when clicked.
The header is pretty straightforward, in the aura component button, you will have to create the modal box. Eg.: The header will be fixed for the screen flow and that's all.
For footer, you have to create custom aura component that will replace the functionality of the flow navigation. Just copy and paste from this link: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_config_for_flow_screens_replace_footer.htm
Then, remove the standard footer in the screens of the flow, and add the custom button instead.
Now the tricky to sticky the footer in the modal:
Still in the custom footer flow component, create the following CSS (you can customize to adjust in your needs):
Please note that this CSS refer to a class "slds-card__footer". This class needs to be applied in the in the component you have just created:
Create a helper that will calculate the position of the footer: Call the helper function from afterRender, this way, every time the flow changes for the next page, or some validation rule is applied, the footer position will be recalculated: Finally, in the controller, add in the init funtion a listerner to window resize, this way the footer will be repositioned automatically on browser resize.
Hope it helps.
Guilherme