Hi!
In 6.2.2, if the same resource is available before and after remote filtering (I think this is this issue), the scheduler throws with error: Unknown identifier ModelClass-796.$.effectiveCalendar
.
See demo code and screen cast.
Thanks!
Hi!
In 6.2.2, if the same resource is available before and after remote filtering (I think this is this issue), the scheduler throws with error: Unknown identifier ModelClass-796.$.effectiveCalendar
.
See demo code and screen cast.
Thanks!
Thank you for the report.
We will fix: https://github.com/bryntum/support/issues/11335
Regards
Joakim
Thanks Joakim,
Managed to reproduce another issue as well, where the loading indicator gets stuck if triggering filtering on event or assignment store. See attachments.
Hi Joakim,
We have encountered the same '$.effectiveCalendar' issue as well.
The code snippet below is based on the following example: https://bryntum.com/products/schedulerpro/examples/resource-non-working-time/
On the initial load, the scheduler renders without any issue. But if you re-load the scheduler's data (clicking the 'Load' button twice), there is a console error. The resources are rendered in the Scheduler, but not the events.
It seems the ProjectModel doesn't clear out lazy store's data upon re-load, since the issue doesn't happen if you clear all stores before calling load.
import { SchedulerPro, DateHelper, Tooltip, Toast, Store } from '../../build/schedulerpro.module.js?485313';
import shared from '../_shared/shared.module.js?485313';
const myStore = new Store({ id: 'myStore'});
const scheduler = new SchedulerPro({
project : {
crudStores: [myStore],
lazyLoad: true,
resourceStore: {
tree: true,
},
loadUrl : './data/data.json',
listeners: {
beforeLoadApply: ({ response, options }) => {
const defaultResponse = () => ({
total: 0,
rows: [],
});
// console.log(response);
delete response.project;
delete response.calendars;
delete response.resources;
delete response.events;
delete response.assignments;
delete response.resourceTimeRanges;
console.log(options);
if (options['stores'].includes('calendars')) {
response['calendars'] = defaultResponse();
response.calendars.total = 1;
response.calendars.rows = [{
id: 1,
name: 'Week Days',
intervals: [{
id: 1,
recurrentStartDate: 'on Mon at 0:00',
recurrentEndDate: 'on Tues at 0:00',
}]
}];
}
if (options['stores'].includes('events')) {
response['events'] = defaultResponse();
if (options.params.parentId === 'root') {
response.events.total = 1;
response.events.rows = [{
id: 1,
startDate: '2020-03-22',
endDate: '2020-03-23',
}]
}
}
if (options['stores'].includes('resources')) {
response['resources'] = defaultResponse();
if (options.params.parentId === 'root') {
response.resources.total = 2;
response.resources.rows = [{
id: 1,
name: 'Bob',
calendar: 1,
children: false,
remoteChildCount: 0,
},
{
id: 2,
name: 'Joe',
calendar: 1,
children: true,
remoteChildCount: 1,
}];
}
else if (options.params.parentId === 2) {
response.resources.total = 1;
response.resources.rows = [{
id: 3,
name: 'Little Joe',
calendar: 1,
children: false,
remoteChildCount: 0,
}];
}
}
if (options['stores'].includes('assignments')) {
response['assignments'] = defaultResponse();
if (options.params.parentId === 'root') {
response.assignments.total = 1;
response.assignments.rows = [{
id: 1,
eventId: 1,
resourceId: 1,
}]
}
}
if (options['stores'].includes('dependencies')) {
response['dependencies'] = defaultResponse();
}
if (options['stores'].includes('resourceTimeRanges')) {
response['resourceTimeRanges'] = defaultResponse();
}
if (options['stores'].includes('myStore')) {
response['myStore'] = {
total: 1,
rows: [{
id: '1',
name: 'X',
status: 'Active'
},
{
id: '2',
name: 'W',
status: 'Active'
}]
}
}
},
}
},
appendTo : 'container',
startDate : '2020-03-23T07:00',
endDate : '2020-03-23T23:00',
resourceImagePath : '../_shared/images/users/',
features : {
tree: true,
nonWorkingTime : false,
resourceNonWorkingTime : {
maxTimeAxisUnit : 'day'
}
},
tbar: [{
type: 'button',
text: 'Load',
onAction: () => scheduler.project.load(),
}, {
type: 'button',
text: 'Reset',
onAction: () => {
console.log('myStore', myStore.allRecords[0]);
scheduler.project.crudStores.forEach(({store}) => store.removeAll())
},
}],
columns : [
{
type : 'tree',
text : 'Worker',
field: 'name',
},
{
type : 'resourceCalendar',
text : 'Shift',
width : 120
}
],
});