Premium support for our pure JavaScript UI components


Post by jimmycallin »

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!

Attachments
scheduler-bugs.zip
(528.42 KiB) Downloaded 8 times
Skärminspelning 2025-05-13 kl. 14.04.47.mov
(10.46 MiB) Downloaded 11 times

Post by joakim.l »

Thank you for the report.

We will fix: https://github.com/bryntum/support/issues/11335

Regards
Joakim


Post by jimmycallin »

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.

Attachments
scheduler-bugs 2.zip
(133.66 KiB) Downloaded 7 times
Skärminspelning 2025-05-13 kl. 22.15.48.mov
(4.86 MiB) Downloaded 7 times

Post by joakim.l »

Regards
Joakim


Post by xminaya »

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.

Animation.gif
Animation.gif (907.82 KiB) Viewed 159 times
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
    }
],
});

Post by joakim.l »

Thank you for the report. We're working on fixing it, and will include this case as a test.

Regards
Joakim


Post Reply