Is there a complete Blazor project code for this demo? I suspect the split task function failed.
I found this https://github.com/SyncfusionExamples/customizable-task-editor-in-blazor-gantt , but it cannot show this exact result:
I know that is using an old version of Blazor, but I do not mind.
Hi Desmond,
Greetings from
Syncfusion Support,
Regarding your query, we have prepared
sample based on shared UG reference and as per
attached image we have added task Label along with
it. We have included the task label in the sample and have attached the code
snippet below for your reference.
|
<SfGantt @ref="gantt">
<GanttTemplates TValue="TaskData"> <TaskbarTemplate> @{ … @if (segments != null && segments.Count() > 1) { foreach (var segment in segments) { string textContent = "Segment " + (segment.SegmentIndex + 1); <div class="e-gantt-child-progressbar-inner-div e-gantt-child-progressbar" style="height:24px;width:@(segment.ProgressWidth + "px");border-radius: 0px;text-align: right;"> <div style=@("height:22px;position: absolute;line-height:21px;font-size: 11px;color: #fff;text-overflow:ellipsis;overflow-x:hidden;")> <span>@textContent</span> </div> </div> …
</div> } } … } </TaskbarTemplate> </GanttTemplates> </SfGantt> |
Sample link: https://blazorplayground.syncfusion.com/embed/rXLpZQVVyMLxlrhz?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5
If you have any further questions or need additional assistance, please let me
know!
Regards,
Ajithkumar G
May I know if it is possible to do the same thing in v20.3.47? Coz GetRowTaskModel() is not available in that version.
If I must upgrade, can I get a zip file demo of the demo you made, in NET6.0, coz I get the error:
Microsoft.JSInterop.JSException: Could not find 'sfBlazor.Tooltip.showTooltip' ('sfBlazor' was undefined).
Hi Desmond,
Yes, you need to update the Gantt version because split task support has been provided in 25.1.35 version. So upgrade to minimal of 25.1.35 or 26.1.42 version. And also we have attached release notes
refer it.
Release notes: https://blazor.syncfusion.com/documentation/release-notes/25.1.35?type=all#features-10
We have prepared the Gantt chart with .net6. We
have attached sample for
reference. The reported
issue may occurs when script not properly applied in your project. We have attached UG
document refer it.
|
//_Layout.cshtml … <link rel="stylesheet" rel='nofollow' href=https://cdn.syncfusion.com/blazor/26.1.42/styles/fabric.css /> <script src=https://cdn.syncfusion.com/blazor/26.1.42/syncfusion-blazor.min.js type="text/javascript"></script> </head> .. </SfGantt> @code { } |
Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SplitTask-688449203.zip
For more information, you may refer to the following
link:
https://blazor.syncfusion.com/documentation/gantt-chart/getting-started
If you have any further questions or need additional assistance, please let me
know!
Regards,
Ajithkumar G
Thanks for your zip file. On top of this question, may I know if there is a simple way to handle CRUD of segments and taskbars at the same time? SegmentChanging="SegmentEventHandler" only allows CRUD of segments, what about the taskbars, shall I use OnActionComplete or what to do CRUD of taskbars?
Hi Desmond,
To achieve your requirements, we suggest to use the SegmentChanging and TaskbarEdited
events in the Gantt chart. When a segment in the taskbar is edited, the
SegmentChanging event is triggered. Additionally, the TaskbarEdited event is
triggered for overall taskbar changes, as well as for normal taskbar edits. We
have attached a code snippet and a link to the user guide for reference.
|
<SfGantt @ref="gantt" TValue="TaskData"ProjectEndDate="projectEnd">
<GanttSegmentFields SegmentChanging="SegmentEventHandler"></GanttSegmentFields> … <GanttEvents TaskbarEdited="TaskbarEdited" TValue="TaskData"></GanttEvents> </SfGantt> {
} public void TaskbarEdited(TaskbarEditedEventArgs<TaskData> args) { // Here, you can get the error details in the args. } |
For more
information, you may refer to the following link:
https://blazor.syncfusion.com/documentation/gantt-chart/events#taskbaredited
https://blazor.syncfusion.com/documentation/gantt-chart/split-task#segment-event
If you have any further questions or need additional assistance, please let me
know!
Regards,
Ajithkumar G