Resource CRUD & sources
Keep the resource directory connected to application state rather than embedding it permanently in a view. Resource APIs and sources support dynamic records, loading, refresh, and paginated collections.
Loading interactive demo…
What you configure
- resources
- Start with a static collection of stable resource IDs and titles.
- resourceSources
- Connect resource loaders or URLs and adapt your response shape.
- source request data
- Pass the range and pagination information required by your resource service.
Essential integration
This assumes the shared Quick start already provides premiumLicense and, for UI views, premiumCalendarOptions. Only the feature-specific setup is shown.
import { WtsCalendar } from '@wts-calendar/core';
import { resourceSchedulingModule } from '@wts-calendar/core/resource-scheduling';
const calendar = new WtsCalendar({
...premiumCalendarOptions,
plugins: [resourceSchedulingModule],
view: 'resource-timeline',
resources: [],
events: [],
resourceSources: [
{
id: 'directory',
// Replace this in-memory directory with your own async loader.
loader: async () => [
{ id: 'design', title: 'Design studio', capacity: 2 },
{ id: 'engineering', title: 'Engineering', capacity: 4 },
],
},
],
});
calendar.addResource({ id: 'support', title: 'Support', capacity: 2 });
calendar.updateResource('support', { title: 'Support desk' });
calendar.removeResource('support'); // No events reference this sample resource.
export async function refreshDirectory() {
await calendar.refetchResources('directory');
return calendar.getResources();
}Behavior and lifecycle
- Resource loading is separate from the event collection so each can follow its own data lifecycle.
- Paging allows a large directory to be supplied in smaller responses.
Limits and responsibilities
- The package does not provide a resource database or a hosted directory endpoint.
- Decide how your application handles events assigned to resources that are removed or no longer visible.
Premium
Enable this capability
- Optional module
- @wts-calendar/core/resource-scheduling
- Local capability ID
- resource-scheduling · enabled by package-wide Premium
Use the request form to describe your project and deployment origins. Pricing and terms are confirmed privately. A WTS license is separate from provider credentials; do not send passwords or production access tokens.
The live example uses a browser-visible deployment key restricted to this package and approved origins. It does not collect license keys or visitor credentials.