Our state of the art Gantt chart


Post by misto »

Hi,
I want to calculate start date of tasks using scheduling engine, but is not working.

Result: null, 2000-01-01, 2000-01-01
Excepted: 2000-01-01, 2000-01-01, 2000-01-10

NB: I can't use SchedulerProProjectMixin because it is using window.

// import { SchedulerProProjectMixin } from './lib/Engine/quark/model/scheduler_pro/SchedulerProProjectMixin.js';
// const project = new SchedulerProProjectMixin();
import { SchedulerCoreProjectMixin } from './lib/Engine/quark/model/scheduler_core/SchedulerCoreProjectMixin.js';
const project = new SchedulerCoreProjectMixin();
project.loadInlineData({
    eventsData: [
        {
            name: 'All Tasks',
            id: 'all',
            children: [
                { id: 't1', name: 'Task 1', startDate: '2000-01-01', endDate: '2000-01-10' },
                { id: 't2', name: 'Task 2', startDate: '2000-01-01', endDate: '2000-01-10' }],
        }
    ],
    dependenciesData: [
        {
            id: 't1', fromEvent: 't1', toEvent: 't2',
        }
    ],
}).then((res) => {
    project.eventStore.forEach(element => {
        console.log(element.startDate);
    });
}).catch((err) => {
});

Post by misto »

If I'm using SchedulerProProjectMixin (uncomment window.DEBUG) everything works fine.


Post by sergey.maltsev »

Hi, misto!

I've checked a bit modified code with latest Nightly Build we have in Customer Zone (schedulerpro-2020-07-02-next).
All works fine with Node JS 14.5.

App code.

import { SchedulerProProjectMixin } from './lib/Engine/quark/model/scheduler_pro/SchedulerProProjectMixin.js';
const project = new SchedulerProProjectMixin();
project.loadInlineData({
    eventsData: [
        {
            name: 'All Tasks',
            id: 'all',
            children: [
                { id: 't1', name: 'Task 1', startDate: '2020-01-01', endDate: '2020-01-5' },
				{ id: 't2', name: 'Task 2', duration: '11' }
			]
        }
    ],
    dependenciesData: [
        {
            id: 'd1', fromEvent: 't1', toEvent: 't2',
        }
    ],
}).then((res) => {
	project.eventStore.forEach(element => {
        console.log(`${element.name} : ${element.startDate} - ${element.endDate}`);
    });
});

Please download and check with the latest Nightly sources.


Post by misto »

Thanks, it's ok for me, I compiled sources (ts) with "module": "commonjs"and some ts-ignore, so I can use in node 12.


Post by irichter »

Hey Misto,

Would you mind sharing your project config? I'm planning to do something similar using GanttProjectMixin. I tried both JS and TS with different setups but ran into problems each time (module issues, TS compilation issues, lint problems etc.).

It's great that you were able to get it working using node 12.

Your help would be greatly appreciated.

Cheers,
Istvan


Post by misto »

Hi Istvan,

1/ Unzip

bryntum-engine.zip
(54.85 KiB) Downloaded 169 times

2/ Follow instructions (README.md)


Post by irichter »

Hi Mihai,

WOW, this is much more complex than I thought. You spared an awesome lot of time of trial and error for me.

Thanks!

Regards,
Istvan


Post Reply