This is a migrated thread and some comments may be shown as answers.

Gantt - force parent dates recalculation and refresh

11 Answers 336 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Aljoša
Top achievements
Rank 1
Aljoša asked on 29 Aug 2017, 07:19 AM
hi,
is there a way to force parent dates to refresh and draw parent (summary task) accordinglly, like it is done when (child) task is moved?

Example:
My data source (last one is parent with start = end)
<KendoGanttItem><id>10741</id><start>19.09.16 05:00</start><end>19.09.16 08:00</end><parentId>13086</parentId>...</KendoGanttItem>
<KendoGanttItem><id>11086</id><start>19.09.16 13:00</start><end>19.09.16 14:00</end><parentId>13086</parentId>...</KendoGanttItem>
<KendoGanttItem><id>13086</id><start>19.09.16 00:00</start><end>19.09.16 00:00</end><summary>Yes</summary><expanded>Yes</expanded>...</KendoGanttItem>
When I move 1 of the child tasks, parent gets start and end date and is drawn accordingly.
That is what I would like to achive programmatically.
I tried
Gantt.Refresh(),
Tried setting some property so it could refresh
    $("#gantt").data("kendoGantt").dataSource.view()[2].set("expanded", false);
    $("#gantt").data("kendoGantt").dataSource.view()[2].set("expanded", true);

Thanx

11 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 31 Aug 2017, 05:55 AM
Hi AljoĊĦa,

As far as I can understand, initially you have a parent task, which start and end dates do not match the start and end of its children. If this is the case, I am afraid, that the Gantt API would not offer you the possibility to update the summary task dates. The Gantt chart DataSource members are expected to match properly their start / end dates.

In case you think that such functionality would add value to the widget, I would suggest you to log your idea in our Feedback portal.

Regards,
Veselin Tsvetanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Aljoša
Top achievements
Rank 1
answered on 31 Aug 2017, 06:48 AM

Hi Veselin,

you did understand me correctly. So it cannot be done programmatically...

Is there any way to fire move event on task, because when task is moved, "parent task" does get new start and end dates...

Check my attachment (sorry for not including it before...)

In 3rd step you can see that parent appears on screen, and it gets correct dates and it happens after task move event...

Thanks for your suggestions and reply.

BR

0
Veselin Tsvetanov
Telerik team
answered on 04 Sep 2017, 06:35 AM
Hi AljoĊĦa,

The move event of the Gantt could be manually triggered using the trigger() method of the widget (gantt.trigger('move');). This, however, won't force the parent (summary) task to update its start and end. It will update those values only, when a user interaction is detected. Therefore, I am afraid, that the widget does not offer a way to programmatically trigger update of the discussed values.

Regards,
Veselin Tsvetanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Aljoša
Top achievements
Rank 1
answered on 06 Sep 2017, 12:25 PM

Hi Veselin,

thank you again.

BR

0
Vaishali
Top achievements
Rank 1
answered on 04 Sep 2019, 05:23 PM

Hi,

https://demos.telerik.com/kendo-ui/gantt/index - If you look at this example, the summary start and end date gets recalculated based on the changes in the child task. How is this achieved? 

0
Veselin Tsvetanov
Telerik team
answered on 06 Sep 2019, 07:51 AM

Hello Vaishali,

By default, upon user interaction (edit, resize, move), the Gantt widget will update accordingly all parents of the Task that has been changed. This is done automatically, so you won't need to do anything extra to get that behavior.

Regards,
Veselin Tsvetanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vaishali
Top achievements
Rank 1
answered on 06 Sep 2019, 03:08 PM
Thanks for your response. Which verion onwards this feature is supported? I am not getting this feature by default.
0
Vaishali
Top achievements
Rank 1
answered on 09 Sep 2019, 07:53 PM
Any update on this?
0
Veselin Tsvetanov
Telerik team
answered on 10 Sep 2019, 07:51 AM

Hi Vaishali,

I have tested the Gantt widget with Kendo version Q2 2014.2.716 when the widget has been introduced. It properly updates the parent start/end dates upon child edit/resize/move. Here you could find a Dojo sample on that.

Regards,
Veselin Tsvetanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vaishali
Top achievements
Rank 1
answered on 26 Sep 2019, 03:10 PM

Hi,

If we manage dates from gantt, this feature works ok. I am trying to edit dates from some other event and that doesnt recalculate the start and end dates or the percentage for the summary task. Here is the dojo example: https://dojo.telerik.com/atakEcUH/11

Can you please suggest how we can achieve it here?

Thanks!

0
Ivan Danchev
Telerik team
answered on 30 Sep 2019, 12:59 PM

Hi Vaishali,

I've posted my reply in the other thread with the same subject: Ticket ID: 1431581. If you have further questions, you can ask them there, in order to avoid thread duplication.

Regards,
Ivan Danchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Gantt
Asked by
Aljoša
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Aljoša
Top achievements
Rank 1
Vaishali
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or