Premium support for our pure JavaScript UI components


Post by chrisb »

Hey guys,

I've been trying to listen to project events (e.g. progress, load), they work fine on local, but as soon as they are deployed in a production build, they do not.

Locally, I have replicated by setting angular compilation settings of aot, optimization, and buildOptimizer to true.

I've tried three different ways of declaring the functions on the listeners object in the projectmodelconfig, as well setting the onLoad or onProgress functions. it doesn't seem to matter what I do, they won't fire. This issue is not present on listeners on the gantt config.

I'm using the gantt.lite.umd file.

Any help would be appreciated.

Thanks


Post by saki »

The issue is confirmed, it behaves as you describe. The ticket is here: https://github.com/bryntum/support/issues/2889 – please subscribe to the changes of this ticket to be updated on the progress.


Post by saki »

When I installed listeners after the project was created then it worked, so you can use it as a workaround:

import { ProjectModel } from '@bryntum/gantt/gantt.lite.umd.js';

const project  = new ProjectModel({
    autoLoad  : true,
    transport : {
        load : {
            url : 'assets/data/tasks.json'
        }
    },

    // does not work
    // listeners : {
    //     progress : function() {
    //         console.log('progress');
    //     },
    //     load : function() {
    //         console.log('load');
    //     }
    // }

    enableProgressNotifications : true

});

// works
project.on({
    progress() {
        console.log('progress');
    },
    load() {
        console.log('load');
    }
});

Note: We are still investigating the root of the issue.


Post by chrisb »

Yep, that was the only workaround I found too.


Post Reply