This project contains a complete integration of DHTMLX Widgets for Lightning Web Components on Salesforce Platform, including:
- π Scheduler - Event calendar and timeline management
- π Kanban - Task board with drag-and-drop functionality
- π Gantt - Project management with task dependencies
The sample is implemented with the help of JavaScript libraries from DHTMLX.
- Read Salesforce docs Developer Hub in your organization
- Apply for Salesforce Dev trial
- Install the Salesforce CLI
-
Create a Salesforce Developer Account
Sign up here -
Enable Dev Hub
- Go to Setup > Dev Hub and enable it.
-
Configure My Domain
- In Quick Find, search for
My Domain
. - Copy your domain (e.g.,
orgfarm-699063b98a-dev-ed.develop.my.salesforce.com
). - Paste it into your
sfdx-project.json
.
- In Quick Find, search for
-
Authenticate with Salesforce CLI
sfdx auth:web:login -d -a dhtmlx
- Use any alias (e.g.,
dhtmlx
). - You can find your username in Salesforce under Users.
- Use any alias (e.g.,
-
Create a Scratch Org
sfdx org create scratch -f config/project-scratch-def.json
-
Deploy Source Code
sfdx force:source:deploy -p force-app
-
Set Trusted URLs
- If your code uses images, add their URLs to Trusted URLs in Salesforce settings.
- For demo images and attachments, this project uses https://snippet.dhtmlx.com as an external image host.
Make sure to addhttps://snippet.dhtmlx.com
to the list of Trusted URLs in your Salesforce org.
-
Configure Profile Tab Visibility
- Go to Setup β Users β Profiles
- Find and edit your user profile (e.g., "System Administrator")
- In Custom App Settings section, locate the DHTMLX components
- Set Tab Settings for Gantt, Kanban, and Scheduler tabs to Default On or Visible
- Save the profile changes
To enable file uploads and attachments in the Kanban component, you need to create a Content Library:
- Navigate to Files β Libraries β New Library
- Create New Library:
- Name:
KanbanFiles
(recommended) - Description: "File storage for Kanban card attachments"
- Name:
- Configure Library Settings:
- Enable "Allow external access to this library via APIs"
- Set appropriate content types (Images, Documents, etc.)
- Set Library Permissions:
- Add all Kanban users as library members
- Grant "Library Administrator" or "Author" permissions
- Enable "Upload Content" permission
If you used a different library name than "KanbanFiles":
- Open
force-app/main/default/classes/KanbanData.cls
- Find line 3:
private static final String LIB_NAME = 'KanbanFiles';
- Replace
'KanbanFiles'
with your actual library name - Redeploy the class to your org
Note: This step is only required if you named your library differently than "KanbanFiles".
By default, the demo uses hardcoded user IDs that may not exist in your organization. To display all active users from your org:
-
Open KanbanData.cls
- Navigate to
force-app/main/default/classes/KanbanData.cls
- Find the
getUsers()
method around lines 109-116
- Navigate to
-
Uncomment User Query Code
- Comment out the demo-specific user filtering
- Uncomment the lines that retrieve all active users from your organization:
List<User> us = [ SELECT Id, Name, SmallPhotoUrl FROM User WHERE IsActive = true ORDER BY Name ];
-
Redeploy Changes
sfdx force:source:deploy -p force-app/main/default/classes/KanbanData.cls
Note: In large organizations, this may return many users and impact performance. Consider adding additional WHERE conditions to filter users as needed.
Event calendar with multiple view modes (day, week, month). Manages SchedulerEvent__c custom objects.
Features:
- Multiple calendar views
- Event creation, editing, deletion
- Integration with Salesforce data
Task management board with columns and drag-and-drop functionality. Uses multiple custom objects (KanbanCard__c, KanbanColumn__c, etc.).
Features:
- Drag-and-drop task management
- Customizable columns and swimlanes
- Task assignments and comments
- File attachments support
- Voting and priority management
Project management with task dependencies and timeline visualization. Works with GanttTask__c and GanttLink__c objects.
Features:
- Task hierarchy and dependencies
- Timeline visualization
- Progress tracking
Each component has its own Apex data controller:
- SchedulerData.cls - Manages SchedulerEvent__c data
- KanbanData.cls - Handles all Kanban-related objects
- GanttData.cls - Controls GanttTask__c and GanttLink__c data
Modify the SOQL queries in these classes to adjust data retrieval as needed.
Lightning Web Components are located in force-app/main/default/lwc/
:
- scheduler/ - Scheduler component implementation
- kanban/ - Kanban board component
- gantt/ - Gantt component
Each component contains:
*.js
- Main component logic and DHTMLX integration*.html
- Component template*.css
- Component styling*.xml
- Component metadata
The project uses trial versions of DHTMLX components in force-app/main/default/staticresources/
. For production usage, replace these with licensed versions from your DHTMLX package.
Minimum compatible versions:
- DHTMLX Scheduler v7.2+
- DHTMLX Kanban v1.7+
- DHTMLX Gantt v9.0+
The project includes several custom objects:
Scheduler:
- SchedulerEvent__c - Calendar events
Kanban:
- KanbanCard__c - Task cards
- KanbanColumn__c - Board columns
- KanbanRow__c - Swimlanes
- KanbanComment__c - Task comments
- KanbanAttachment__c - File attachments
- KanbanVote__c - Task voting
- KanbanLink__c - Card relationships
- KanbanCardUser__c - User assignments
Gantt:
- GanttTask__c - Project tasks
- GanttLink__c - Task dependencies
The project includes a pre-configured profile:
- Client Demo Profile - Complete access to all DHTMLX components and objects
Documentation:
Product Pages:
Salesforce Integration:
Star our GitHub repo β
Read us on Medium π°
Follow us on Twitter π¦
Like our page on Facebook π
Problem: Components don't appear in Salesforce interface. Solution:
- Go to Profile settings in Salesforce Setup
- Ensure that Custom Tabs for Gantt, Kanban, and Scheduler are set to "Visible"
Problem: Demo images or icons don't load in the components. Solution:
- Verify that
https://snippet.dhtmlx.com
is added to Trusted URLs in your Salesforce org - Go to Setup β Security β Remote Site Settings and add the trusted domain
Problem: File upload functionality in Kanban doesn't work. Solution:
- Ensure Content Library is created and properly configured
- Check that the library name in
KanbanData.cls
(constantLIB_NAME
) matches your actual library name - Verify that users have proper permissions to upload content to the library
Problem: The user dropdown in Kanban cards is empty or shows limited users. Solution:
- By default, the demo uses specific hardcoded user IDs that likely don't exist in your org
- In
KanbanData.cls
, find thegetUsers()
method around line 109-116 - Comment out the demo user filtering code and uncomment the lines that retrieve all active users:
// Comment out the demo users section and use this instead: List<User> us = [ SELECT Id, Name, SmallPhotoUrl FROM User WHERE IsActive = true ORDER BY Name ];
- Warning: This may return many users and impact performance in large organizations