Page 2 of 2

Re: [INFO REQ] Gantt v5 - No more dataset event?

Posted: Thu Aug 11, 2022 3:15 pm
by quandarycg

I added this - no errors and also no log of 'load' event. Here is my code:

const gantt = new bryntum.gantt.Gantt({
    project,
    rowHeight: 20,
    barMargin: 2,
    flex: 1,
    startDate: self.startDate,
    appendTo: "gantt",
    viewPreset: 'weekDateAndMonth',
    maxZoomLevel: 9,
    features: {
        labels: {
            left: {
                field: 'name',
                editor: {
                    type: 'textfield'
                }
            }
        },
    },
    eventStore: {
        listeners: {
            load: (event) => {
                console.log('event', event);
            }
        }
    },
    columns: [
        { type: 'wbs', persist: true, editor: false },
    ],

});

Re: [INFO REQ] Gantt v5 - No more dataset event?

Posted: Thu Aug 11, 2022 4:05 pm
by marcio

Hey, the eventStore should be inside the project config

const gantt = new bryntum.gantt.Gantt({
    project: {
    	...project,
    	eventStore: {
        	listeners: {
            		load: (event) => {
                		console.log('event', event);
            		}
        	}
    	}
    },
    rowHeight: 20,
    barMargin: 2,
    flex: 1,
    startDate: self.startDate,
    appendTo: "gantt",
    viewPreset: 'weekDateAndMonth',
    maxZoomLevel: 9,
    features: {
        labels: {
            left: {
                field: 'name',
                editor: {
                    type: 'textfield'
                }
            }
        },
    },
    columns: [
        { type: 'wbs', persist: true, editor: false },
    ],
});

Re: [INFO REQ] Gantt v5 - No more dataset event?

Posted: Fri Aug 12, 2022 3:45 pm
by quandarycg

Thank you, so I've added it to the project config and am getting the same result - no log of event. Here is my code:

const project = new bryntum.gantt.ProjectModel({

"eventsData": main_structured_events,

eventStore: {
    listeners: {
        load: (event) => {
            console.log('event', event);
        }
    },
},

"dependenciesData": dependenciesData,

"resourcesData": main_resources,

"assignmentsData": main_assignments,

validateResponse: true
});

Re: [INFO REQ] Gantt v5 - No more dataset event?

Posted: Mon Aug 15, 2022 8:32 am
by tasnim

Could you please provide a runnable test case so we can debug it?


Re: [INFO REQ] Gantt v5 - No more dataset event?

Posted: Mon Aug 15, 2022 2:39 pm
by quandarycg

Could you copy the demo gantt code and try to get the onload event to work? Once you can get an event to log on load in the console then I can reuse the solution.


Re: [INFO REQ] Gantt v5 - No more dataset event?

Posted: Mon Aug 15, 2022 7:55 pm
by marcio

Hey,

I just shared the code of our basic latest version Gantt demo with the eventStore load listener working correctly (as you see in the attached screenshot).


Re: [INFO REQ] Gantt v5 - No more dataset event?

Posted: Mon Aug 15, 2022 8:21 pm
by quandarycg

I see, so I am loading in tasks through "eventsData" and then trying to also have an "eventStore" property on the project. Would this be a possible issue with why I am not seeing the event dispatch? If so, how can I pass both eventsData (array of data) and eventStore( for data onload event listener)?

const project = new bryntum.gantt.ProjectModel({
    eventsData: main_structured_events,
    eventStore: {
        listeners: {
            load: (event) => {
                console.log('event', event);
            }
        },
    },
});

Re: [INFO REQ] Gantt v5 - No more dataset event?

Posted: Tue Aug 16, 2022 3:14 pm
by quandarycg

Instead of setting up the project using the ProjectModel, I've moved the configs to be directly in the gantt like so:

const gantt = new bryntum.gantt.Gantt({
                        project : {
                            autoLoad  : true,
                            transport : {
                                load : {
                                    url : 'https://our-hosted-url.com/bryntum-gantt-v5.1.1/gantt-5.1.1/examples/_datasets/launch-saas.json'
                                }
                            },
                            eventStore : {
                                listeners : {
                                    load : (event) => {
                                        console.log('load event store', event);
                                    }
                                }
                            }	
                        }
                        }

This works. So it appears that if we load the data using 'transport' via URL, this 'load' event listener works. Is there a method to load in the actual project data instead of a URL and still have the 'load' event dispatch?


Re: [INFO REQ] Gantt v5 - No more dataset event?

Posted: Tue Aug 16, 2022 7:46 pm
by marcio

Oh, ok, perhaps you can use the https://bryntum.com/docs/gantt/api/Gantt/model/ProjectModel#event-dataReady

or in the Gantt configuration level (not inside project configuration), you can use https://bryntum.com/docs/gantt/api/Grid/view/GridBase#event-renderRows