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

The automatically calculated width of Gantt is incorrect(2)

5 Answers 49 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
維国
Top achievements
Rank 1
Veteran
維国 asked on 04 Aug 2020, 08:25 AM

when splitter moved to the right, Gantt's header's width was expanded,but  The  Width of Gantt's timeLine was not expanded.

I think the automatically calculated timeline width of the Gantt chart is wrong

How can I solve this situation´╝č

 

ps Add another picture.

5 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 06 Aug 2020, 07:42 AM

Hi,

As far as I see my colleague Ivan has already replied in the other thread regarding the same issue. For convenience, I will paste his suggestion here as well. I will recommend keeping the conversation in a single thread. 

Since in this scenario the pane acts as a container for the Gantt, it might need to be resized programmatically. Try attaching a "resize" event handler to the Splitter and call the Gantt's resize method in the handler:

$("#splitter").kendoSplitter({
  panes: [ { collapsible: true }, {} ],
  resize: function(e) {
    var gantt = $("#gantt").data("kendoGantt");
    gantt.resize();
  }
});

 

Please give a try to the suggestion from above and let us know in case you need further assistance on the matter. 

Regards,
Neli
Progress Telerik

0
維国
Top achievements
Rank 1
Veteran
answered on 07 Aug 2020, 03:29 AM

Thanks for your answer.

When we use gantt.resize();

 1. when splitter moved to the right, it is worked successfully. The Width of Gantt's timeLine was expanded

 2. when splitter was collapsed, it is not worked successfully.The Width of Gantt's timeLine was not expanded.

Q: Why splitter was collapsed , gantt.resize() is not worked successfully?

0
Neli
Telerik team
answered on 10 Aug 2020, 02:07 PM

Hello,

I have tested locally, but the resize method is called successfully on my end and the Gantt is rendered correctly in a Splitter.

However, I would suggest you use the setTimeout function and test the behavior.  The observed issue could be caused if the resize() method is invoked before the Gantt widget is rendered. By using setTimeout method you will ensure that the resize() is called at the right time and the Gantt is available on the page.  Here is a Dojo example where this is demonstrated. 

Another suggestion is to call the Gantt resize() method when some of the Splitter events are triggered. For example, you could use the expand or collapse event handlers and try to resize the Gantt there.  

I would also recommend you to check the Kendo UI for Angular Forum. As Integrating Kendo UI widgets for jQuery in an Angular application is not officially supported, such problematic behaviors could be discussed by the community in the Forum threads. 

I hope you will find the provided suggestion helpful.

Regards,
Neli
Progress Telerik

0
維国
Top achievements
Rank 1
Veteran
answered on 19 Aug 2020, 01:02 AM

Thank you for your answer

we use setTimeout function and test the behavior.

It worked successfully.

0
Neli
Telerik team
answered on 19 Aug 2020, 03:49 PM

Hello,

Thank you for sharing what has resolved the issue on your end with the community. I am happy that the suggested approach has helped you to find a solution. We always appreciate any feedback as it could be helpful for someone else in the future who has a similar scenario.

Regards,
Neli
Progress Telerik

Tags
Gantt
Asked by
維国
Top achievements
Rank 1
Veteran
Answers by
Neli
Telerik team
維国
Top achievements
Rank 1
Veteran
Share this question
or