Our state of the art Gantt chart


Post by misto »

Hello,
Is it possible to use "bryntum engine" in back-end (node)?


Something like this:
const project = new ProjectModel({
  dependenciesData: data.dependencies.rows,
  tasksData: data.tasks.rows,
});

Post by pmiklashevich »

It's not supported at the moment. But we're working on it. Planning to make it work for both frontend and backend in Q2-Q3 2020. Please stay tuned!

Ticket here: https://github.com/bryntum/support/issues/294

Pavlo Miklashevych
Sr. Frontend Developer


Post by irichter »

Hi Pavel @pmiklashevich, any update on this? We're looking for a solution that can replicate the business logic of the Gantt/Scheduler component to preserve data integrity even when tasks are edited through a back-end API.

Are there any best practices for this?


Post by pmiklashevich »

We don't have an example how to use it for node, but you can already try using our engine on server. We will improve our docs and will come up with a guide and example in the future, though there is no ETA. If you have any questions related to the engine work, please feel free to ask. You can find docs here: https://www.bryntum.com/docs/gantt/engine/

Pavlo Miklashevych
Sr. Frontend Developer


Post by misto »

I have tried (2.1.5 or nightly build):

const ganttLib = require('gantt.module');

but I have an error: self is not defined.

(searchParams: 'URLSearchParams' in self,)


Post by sergey.maltsev »

Hi, misto!

Please attach the whole code we could check.


Post by misto »

Hi,

I commented in gantt.module.js last line (export ...) and I added exports.ProjectModel = ProjectModel;

To test : node index.js

I'm using node 12.

node.zip
(1.13 MiB) Downloaded 161 times

Post by sergey.maltsev »

Hi!

gantt.module currently is not supposed to support backend Node JS.
Node is supported by the Engine sources only.

So you could use Engine from Gantt's lib/Engine folder.


Post by misto »

Hi,
index.js:

import { SchedulerBasicProjectMixin } from './lib/Engine/quark/model/scheduler_basic/SchedulerBasicProjectMixin.js'
const project = new SchedulerBasicProjectMixin({
    eventsData: [{ name: 'Task 1' }]
})

When I run node . , I got:

(node:14148) ExperimentalWarning: The ESM module loader is experimental.
file:///C:/Z-DEV/gantt/lib/Core/data/Store.js:405
if (!rec?.isDestroyed) {
^

SyntaxError: Unexpected token '.'

index.zip
(256 Bytes) Downloaded 127 times

Post by nickolay »

Hi,

You need to use Node 14 because sources uses optional chaining: ?.. And even with Node 14, the esm loader does not support the optional chaining https://github.com/standard-things/esm/issues/866

You can try to use the native Ecma modules support, built-in in the Node, or may be just manually "transpile" the ?. operator - there should be only 2 or 3 places where its needed. The error message indicates the position in sources where it needs to be done.


Post Reply