request-data
Emitted by the store when the visible date range changes (Pro). It is notification-only - there's no built-in store handler. Subscribers such as RestDataProvider or a DynamicLoader catch it, fetch events for that range, and push them back with provide-data.
Usage
type RequestDataPayload = {
startDate: Date;
endDate: Date;
date: Date;
view: string;
};
| Field | Type | Description |
|---|---|---|
startDate | Date | Start of the visible range (inclusive). |
endDate | Date | End of the visible range (exclusive). |
date | Date | Current pivot date of the view. |
view | string | Active view id ("day", "week", "month", ...). |
The range is half-open: [startDate, endDate). The action fires only when startDate or endDate actually changes - a view switch that computes the same range emits nothing. The initial range is replayed after the init callback, so a provider attached there with api.setNext still receives the first request.
Observe
api.on("request-data", ({ startDate, endDate }) => {
loadEvents(startDate, endDate);
});
Component handler
<Calendar :onrequestdata="p => loadEvents(p.startDate, p.endDate)" />
Related articles
- Dynamic loading - the full range-loading pipeline.
provide-data- push the fetched events back into the store.on- subscribe to the action.