Application State And Persistence
Your application owns persisted project data. Gantt owns scheduling, validation, projection, and supported local mutations while the grid is mounted.
State Boundary
Section titled “State Boundary”Keep these collections together as one logical project snapshot:
source: authored task rows.ganttDependencies.ganttCalendars.ganttResources.ganttAssignments.ganttBaselines.gantt: project metadata and behavior configuration.
When a server response or collaborative update arrives, replace affected arrays and assign a new gantt object when configuration changed. Do not mutate an existing array in place and expect framework or custom-element change detection to observe it.
function applyProject(snapshot: ProjectSnapshot) { grid.gantt = { ...snapshot }; grid.ganttCalendars = [...snapshot.calendars]; grid.ganttDependencies = [...snapshot.dependencies]; grid.ganttResources = [...snapshot.resources]; grid.ganttAssignments = [...snapshot.assignments]; grid.ganttBaselines = [...snapshot.baselines]; grid.source = snapshot.tasks.map(toSourceRow);}Save Flow
Section titled “Save Flow”- Listen for the Gantt before-change events when the application needs authorization or validation.
- Allow Gantt to commit supported local mutations.
- Read the current project through the
GanttPlugininstance or the application state updated by your integration. - Persist a complete snapshot or an application-defined patch.
- Replace the public collections with the canonical server result when the server normalizes data.
Use JSON project helpers for snapshots and integration recipes for REST, GraphQL, PostgreSQL, and Supabase-style persistence.
Concurrent Updates
Section titled “Concurrent Updates”- Use stable entity IDs across every collection.
- Version project writes in your backend and reject stale updates.
- Re-run scheduling after dependency, calendar, task, resource, or assignment updates.
- Keep optimistic rollback data outside the rendered DOM.
- Use
gantt.readOnlywhile a project is locked or awaiting approval.
See Events And Methods for cancelable events and plugin access.