Our state of the art Gantt chart


Post by jhughesoneplan »

Hi there,

I'm currently seeing an issue when appending a child to a parent node.

Upon appending the child to the parent, it seems like numeric data is being rolled up from the child to the parent.

We are doing on demand loading of children, so upon expand of the parent node - load all of the children underneath.

This is how we're handling it:

$.ajax({
									type: "POST",
									url: "/api/myroute1234",
									record: a.record,
									data: JSON.stringify(o),
									contentType: "application/json; charset=utf-8",
									success: function (data) {
										if (data.tasks != null && data.tasks.rows.length > 0) {
											this.record.appendChild(data.tasks.rows);

										if (data.dependencies != null && data.dependencies.rows.length > 0)
											Gantt._dependencyStore.add(data.dependencies.rows);

									} else {
										this.record.meta.isLeaf = true;
										this.record.clearChildren()
										this.record.set("leaf", true);
									}
								},
							});

Here is what I'm seeing:

  • Parent record has a '% done' of 20%.

  • Append a child node that has a '% done' of 75%. (Using above code)

  • Check parent record - see the '% done' is now 75% (changed from the original 25%).

We have disabled the rollup feature, so I don't expect this to be happening.
We have also disabled aggregates on these columns, but it doesn't make a difference if the parent record is being manipulated.

Is this by design? If so, how can we prevent this?

Thanks


Post by marcio »

Hey jhughesoneplan,

Thanks for reaching out and for the detailed description.

The snippet that you shared doesn't look like the cause of the issue, and if you add a child node, it's by design to impact the % done of the parent node.

If I understood correctly, in your use case, do you want the child's percentage of done not to have an impact on the parent node?

Best regards,
Márcio


Post by jhughesoneplan »

Hi Marcio,

That is correct.

We don't want the percent done of the child node to rollup and impact the percent done of the parent node.

The parent node and the child nodes both have their own schedules with tasks - and as a result will have separate data.


Post by Maxim Gorkovsky »

Hello.
You can find few solutions explained on this forum. For instance, you can try one from this thread: viewtopic.php?p=130435&hilit=calculatePercentDone#p130435

What you need to do is to override default calculatePercentDone function to provide a different value.


Post by jhughesoneplan »

Hi Maxim,

This applies to all number columns, not just percent done.

I don't think this will fit for my scenario.


Post by Maxim Gorkovsky »

Well, you can always create your own fields for values which are calculated somewhere else, like myPercentDone and then change task template and render that value as you like. If you're looking into altering project behavior - overrides is the only way. In your case custom template will probably work better.


Post Reply