calendar.resourceTimeRangeStore.add({
resourceId: resourceId,
startDate: startDate,
endDate: endDate
});
That should have an id
“Id” is the name of the id field by which links are made.
The time ranges render a header to the side of the event flow, but to do that, they need a name
.
If you do not want to see some rotated text like in the online example, you can use space.
See the example here which uses your setup: https://codepen.io/Animal-Nige/pen/NPPWLoL?editors=0010
I have tried several things, but still without a working result, even with using the provided example:
None of these resolved the issue and I still do not see any time ranges in my view. The example does show it for me, though.
Hi Animal,
It is showing me an empty array. Down below you can find my code on how I add entries to the time range store. Am I doing something wrong?
// Only if the active view is that of a resource, process the availability time ranges.
if(isResourceView) {
// Retrieve the availability response.
const availability = requestTasksResponses[1].value;
// Process the availability as time ranges in the calendar view.
for (const [resourceIdString, availabilityEntries] of Object.entries(availability)) {
const resourceId = Number(resourceIdString);
for (const { startDate, endDate } of availabilityEntries) {
// Validate start and end date
if (startDate > endDate)
continue;
// Add a new record to the time range store.
calendar.resourceTimeRangeStore.add({
resourceId: resourceId,
startDate: startDate,
endDate: endDate
});
}
}
calendar.resourceTimeRangeStore.add({
resourceId: resourceId,
startDate: startDate,
endDate: endDate
});
What about the name
?
As stated above (viewtopic.php?p=166832#p166832), The time ranges render a header to the side of the event flow, but to do that, they need a name
.
Hi,
Please attach a runnable test case, it will get us a chance to help you out and not guessing! No idea why it didn't work, it does in our examples.
All the best,
Alex Lazarev
How to ask for help? Please read our Support Policy
We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services