FullCalendar Plugin in Salesforce Lightning Component
Author
May 7, 2019
Fullcalendar plugin is quite a useful tool for many calendar-related applications. It has been widely used with various javascript applications and even visualforce pages.
However, this plugin is also compatible with lightning as it is entirely created using jQuery.
The first step in using this plugin with your lightning component is to download it and upload it as a zip folder to your dev org as a static resource.
The second step is to include it in your lightning component –
<ltng:require styles=”{!$Resource. StaticResourceName + ‘/fullcalendar-3.8.0/fullcalendar.css’}” scripts=”{!join(‘,’,
$Resource.StaticResourceName + ‘/fullcalendar-3.8.0/lib/jquery.min.js’,
$ Resource.StaticResourceName + ‘/fullcalendar-3.8.0/lib/moment.min.js’, $Resource.StaticResourceName + ‘/fullcalendar-3.8.0/fullcalendar.js’)}” afterScriptsLoaded=”{!c.doInit}” />
Please make sure that all the components are added, and the file paths are correct.
Once you use the above statement in your component, the doInit method becomes your entry point. It can of course be renamed to anything you like.
In the third step let us define the controller method
Once the header is defined, the calendar takes form in your component although it would not do anything yet.
The Header
You can customize the look as you wish. If the header has no basicWeek or agendaWeek mentioned under the right key the button to switch to week view will not appear (like in the above screenshot).
Example header and screen:
header: {
left: ”,
center: ‘title’,
right: ”
}
The dayRender method gets called every time a view is loaded, for example when you switch from month view to day view or vice versa.
The eventClickfunction is not mandatory, and you can redirect to any page by clicking on an event by adding an URL you want to the url attribute of the event.
The dayClick function executes when you click anywhere within the day view component on your screen. It is also not a mandatory function.
If you need to execute any apex controller method to show data or events in your calendar, then enclose this method – (‘#calendar’).fullCalendar({ }); in your callback as server-side calls in lightning are asynchronous.
Adding and Removing events
Adding – $(‘#calendar’).fullCalendar( ‘addEventSource’, ev );
Removing – $(‘#calendar’).fullCalendar( ‘removeEventSource’, ev );
Where is an array containing events.
The events array can be populated inside the “dayRender†method as this method is called at the time of loading of each view.
Pranshu Goyal, Director of Products at Mirekta, states: “We envision DSM to be used by every small to a medium-sized organization dealing with bad data and want to get rid of duplicates easily with no cost. We have faced issues dealing with duplicates in our organization. That inspired us to make a solution that is not only simple to use but can be used widely to make the organization’s data clean to make them more efficient and productive. We want DSM to be a solution for every organization looking for duplicate management capability better than the Salesforce out-of-the-box solution with no additional cost.”
Recent Posts
- Salesforce Higher Education: Transforming Modern Universities15 Apr 2025 Blog
- AI Agents The Future of Business Applications09 Apr 2025 Blog
- Why Purpose-Built AI Agents Are the Future of AI at Work07 Apr 2025 Blog
- How the Atlas Reasoning Engine Powers Agentforce03 Apr 2025 Blog
- Leveraging AI for Code Analysis, Real-Time Interaction, and AI-driven Documentation02 Apr 2025 Use-case
- Transforming Healthcare with AI-Powered Patient Health Monitoring with Fitbit & Salesforce01 Apr 2025 Use-case
- 5 Myths About Autonomous Agents in Salesforce28 Mar 2025 Blog
- AI for Nonprofits: Boosting Fundraising with Salesforce Einstein, Agentforce, and Smarter InsightsShape25 Mar 2025 Use-case
- AI-Powered Vaccination Scheduling with Einstein Copilot & Predictive AI21 Mar 2025 Use-case
- Leveraging AI to Enhance Sales Effectiveness13 Mar 2025 Use-case
- Revolutionizing Manufacturing with AI: Predictive Maintenance, Supply Chain Optimization, and More11 Mar 2025 E-Book
- NetSuite for Manufacturing: Streamlining Operations and Solving Key Challenges07 Mar 2025 Blog
- How to Build Your First Agent in Salesforce Agentforce24 Feb 2025 Blog
- ERP vs Salesforce Revenue Cloud: Which One is Right for Your Business?24 Feb 2025 E-Book
- Revolutionizing Manufacturing with Salesforce: A Playbook for Efficiency & Growth18 Feb 2025 E-Book
- Salesforce 2025 Game-Changing Trends You Need to Know28 Jan 2025 Blog
- Agentforce 2.0: Everything You Need to Know About the Latest Update22 Jan 2025 Blog
- The Ultimate Guide to NetSuite Development: Tools and Techniques10 Jan 2025 Blog
- How Salesforce Nonprofit Cloud Transforms Fundraising Strategies10 Jan 2025 Blog
- The Impact of Salesforce Development Partners on Small and Medium Businesses08 Jan 2025 Blog
Categories
Featured by



