Always rendered as type "task"

Hi,

I’m trying to render one of the task as project, to ignore “start_date” and “end_date”. Even when I set type to “project”, rendered object still have property $rendered_type: “task”, and when I try to delete “start_date” and “end_date” there is exception, because of “$no_end” is false. Here are my object to parse:

project: { id: project._id, text: 'project', open: true, type: 'project' }

and here is rendered object:

project: { $index: 0 $level: 0 $no_end: false $no_start: false $open: true $rendered_parent: 0 $rendered_type: "task" $source: [] $target: [] duration: 7 end_date: Mon Dec 18 2017 23:59:00 GMT+0100 (CET) {constructor: ƒ} id: "tkWPkvCDS9vBiYuan" open: true parent: 0 progress: 0.4 start_date: Tue Dec 12 2017 00:00:00 GMT+0100 (CET) {constructor: ƒ} text: "project 1" type: "project" }

How can I render this task as project ?

Hello!
I cannot face this issue, please try to run at browser console

gantt.parse({“data”:[
{“id”:42, “text”:“Project #42”, type:“project”, “progress”: 0.6, “open”: true}
]});

This will add the “project” to the chart ($no_start = $no_end = true)

To clarify, I’m using react and configured with dhtmlx.com/blog/create-react-ga … tmlxgantt/

When I add task from console it renders correctly, but when I run gantt.getTask(42) it still has property:

$rendered_type: "task"

The issue is when I’m saving “snapshot” of current chart to JSON string, and then trying to reload data with that snapshot:

gannt.clearAll() gannt.parse(jsonSnapshot)
It renders but project task behave like type task…

1 Like

Hi,

The issue is related to the fact that task types is available only in PRO edition. And if you set gantt package via npm - currently you can get only Standart version.

Right now the available solution is to add a PRO package of dhtmlxGantt to your project by hand.
If you want to use it with npm - you could put the package to your private npm feed and install it from there.