Contents
How to implement on scroll action in Lightning?
In your main component’s render.js file attach a listener to the window.onscroll event. As the user scrolls down the page the below code detects once the user has neared the bottom then can take action. In my example, I invoke helper.getNextPage ( component );
Where do I subscribe to the OnScroll event?
Subscribing to the onscroll event is done best in the renderer on afterRender. This is the core logic of detecting a scroll event. Note that I’m using in interval function to notify if the div was scrolled. If this isn’t applied the component could sent out quite a few scroll event.
What is the best way to detect scroll event?
What is the best way to detect scroll event when there are multiple scroll bars. Any Pointers? Thanks in Advance.
Why is there no logic for every scroll?
This will make sure the scrolling remains smooth as no logic has to be executed for every scroll.
Is there a way to scroll content in Salesforce1?
Try to scroll the content horizontally within Salesforce1. There is no workaround at this time. If a component needs to be accessed through Salesforce1 then do not include content formatted to be wider than the device screen.
How to add lightning component to parent object?
From setup ==> go to object Manager ==> and select Account object [Parent]. Next scroll and go to Lightning Record Pages section and click on Account Record Pages link. and click on the edit button. Next find and add your lightning component to record page layout and click on save button.
How to create a lightning record in Salesforce?
Create a Custom Lightning Record Page. From Setup, enter App Builder in the Quick Find box, then select Lightning App Builder. Click New. Select Record Page and start stepping through the wizard. Name your page New Opportunity Page, and select Opportunity. Start typing an object’s name in the Object
How to set record ID in Lightning component?
This attribute is of type String, and its value is an 18-character Salesforce record ID, such as : 001xx000003DGSWAA4. The record ID is set only when you place the component on a lightning experience record page, or invoke it as an action from a record page. See code comments.