Hi,
Can you help about the issues & questions about editing in Gantt:
1 - After editing a task, if I try to reload original data (by a button click) application falls to exception when rerendering toolbar. Exception message:
2 - I was able to disable editing on condition at version 19.4.0.56 like below. Currently this is not working. In particular Edit button is displayed when user clicks on a row. I don't want to display Edit button on specific conditions. Example code:
3 - I want to change the "Edit task" tooltip of Edit button but could not find any property to set. I believe it is set internally. Is there a way to change this tooltip?
An example project is attached.
Thanks & Best regards
Attachment: BlazorSvrSfGantt_71aa895.rar
Hi Yunus,
Greetings from Syncfusion support.
Please find the response for your queries below.
|
Sl.No. |
Query |
Syncfusion Comments
|
|
|
1 |
After editing a task, if I try to reload original data (by a button click) application falls to exception when rerendering toolbar. Exception message: |
Yes, we were able to replicate the issue you reported. We have logged a bug report for it. You can track its status from the below feedback link.
The fix will be provided in the patch release scheduled for May 25, 2022
|
|
|
2 |
I was able to disable editing on condition at version 19.4.0.56 like below. Currently this is not working. In particular Edit button is displayed when user clicks on a row. I don't want to display Edit button on specific conditions. Example code: |
We can resolve this issue in the sample level itself. Please add the below code in your application to resolve this issue.
Index.cshtml
|
|
|
3 |
I want to change the "Edit task" tooltip of Edit button but could not find any property to set. I believe it is set internally. Is there a way to change this tooltip? |
We can use a simple work-around to achieve this requirement. We have surrounded the Gantt Chart with a SFTooltip component. We have used the OnRender event to set the content of the tooltip when hovering over the edit item. The below code snippets demonstrate the solution.
Index.razor
|
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazorSvrSfGantt-668957920
Regards,
Monisha.
Hi Monisha,
Thank you and sorry for late answer.
1 - Thanks for the feedback link, I'll be waiting for the update.
2 - I tried the solution and it is working pretty well, thank you.
3 - I tried the solution and it is feasible to change the popup with this approach, thanks.
However when used together with my 2nd question (displaying Edit button on condition), the application throws below exception when moving mouse over the buttons one after another. When Edit button is not displayed, there is no problem, but when Edit button is displayed then application breaks.
[12:18:47 WRN] Unhandled exception rendering component: TypeError: Cannot read properties of null (reading 'removeChild')
System.InvalidOperationException: TypeError: Cannot read properties of null (reading 'removeChild')
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32[] updatedComponents)
[12:18:47 ERR] Unhandled exception in circuit 'fPltLa6zHfiSzH5eqmac8GD-aKVL4RRUDVLjYQHATgw'.
System.AggregateException: One or more errors occurred. (TypeError: Cannot read properties of null (reading 'removeChild'))
---> System.InvalidOperationException: TypeError: Cannot read properties of null (reading 'removeChild')
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32[] updatedComponents)
--- End of inner exception stack trace ---
Can you check this please?
Thanks and kind regards
Hi Yunus,
We were unable to replicate the issue you reported. We also checked with the edit button and without the edit button. If possible, please share an issue reproducible sample or modify the below attached sample to replicate the issue.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/1748381112805426
Regards,
Monisha.
Hi Monisha,
I could not create the same effect on sample project.
I used a workaround based on your solution and solved my issue.
Thank you very much
Hi Yunus,
You are welcome.
We are glad that you were able to resolve the issue yourself.
Please contact us if you require any further assistance.
Regards,
Monisha.
Hi Yunus,
Thank you for your patience.
The reported issue “Script error thrown when dynamically assigning the data to the gantt” has been fixed in version v20.1.57. Please find the release notes from the below link.
Release Notes: https://blazor.syncfusion.com/documentation/release-notes/20.1.57?type=all#gantt-chart
We would like to inform you that one of your original queries was to be able to disable editing for a task conditionally. We would like to share an alternative and better work-around for it. We have made use of the OnActionBegin and OnCellEdit events to achieve your requirements. The below code snippets demonstrate the solution.
Index.razor
|
public void OnActionBegin(GanttActionEventArgs<TaskData> args) { if ((args.RequestType == Syncfusion.Blazor.Gantt.Action.BeforeOpenEditDialog) && (args.RowData.TaskName.Contains("Project"))) { args.Cancel = true; } }
public void OnCellEdit(CellEditArgs<TaskData> args) { if(args.RowData.TaskName.Contains("Project")) { args.Cancel = true; } }
|
We recommend not using the previously shared work-around, as it may cause issues in taskbar editing. However, if you still insist on using the previous work-around we shared for this query, we would like to add a few changes to it. They are as below:
Index.razor
|
public void OnGanttRowSelect(RowSelectEventArgs<TaskData> args) { if (args.Data.TaskName.Contains("Project")) { _gantt.EditSettings = new GanttEditSettings() { AllowEditing = false, AllowTaskbarEditing = true }; } else { _gantt.EditSettings = new GanttEditSettings() { AllowEditing = true, AllowTaskbarEditing= true }; } }
|
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/174838~1995482630
Regards,
Monisha.
Hi Monisha,
Thank you for the updates and sample code. They are working fine.
Best regards
Hi Yunus,
You are welcome.
Please contact us if you require any further assistance.
Regards,
Monisha.