SfGantt - Dialog for a new task on collapsed diagram

Hi there,

suppose this is our test diagram




and we want to add a new task everything is rendered fine:





Now we collapse all tasks



and want to add a new task, then the dialog becomes very tiny:




Is this behavior on purpose or is it a rendering wrongdoing of the component?

Cheers,
Volker



3 Replies 1 reply marked as answer

PP Pooja Priya Krishna Moorthy Syncfusion Team September 17, 2020 10:19 AM UTC

Hi Volker, 
We render dialog based on Gantt height. From the attached screenshot we note that, you set the auto height. When records are collapsed, only parent records are in the view port. As the height is set as auto, Gantt height will be changed based on the current view records. This is the behaviour of Gantt.  We can resolve this by work-around solution using OnActionComplete event with requestType openAddDialog and openEditDialog for add and edit dialog respectively. 
 
[Inject] 
IJSRuntime JsRuntime { get; set; } 
public async void OnActionComplete(ActionCompleteArgs<TaskData> args) 
{ 
    if (args.RequestType == "openAddDialog") 
    { 
        await JsRuntime.InvokeAsync<ActionCompleteArgs<TaskData>>("dialogHeight", args); 
    } 
} 
[_host.cshtml] 
<body>   
    //… 
    <script src="~/custom.js"></script>   
</body>   
[custom.js] 
function dialogHeight(args) { 
    document.getElementById(args.element.id).style.maxHeight = "480px"; 
} 
 
 
Regards, 
Pooja K. 
 


Marked as answer

VO Volker September 17, 2020 12:07 PM UTC

Hi Pooja,

works wonderfully, thank you very much!

Cheers from Graz/Austria,
Volker


PP Pooja Priya Krishna Moorthy Syncfusion Team September 17, 2020 12:24 PM UTC

Hi Volker,
Most welcome.
Please get back to us if you have any other queries.

Regards,
Pooja K.

Loader.
Up arrow icon