Hi! I'm wondering how I can hide timelines for items where I didn't define start/end dates? In my case it is almost always parent items. I want to show timeline only for children at the very end of my tree.
I have the following data structure sample where I on purpose didn't define any dates for parent or high level tasks. I need to define and show dates only for children tasks where I implicitly defined dates. How is it possible to implement?
And this is how I want it to be displayed
Hi Aaron
Thank you for reaching out to us with your query regarding hiding timelines for items without defined start/end dates. We have reviewed your request and you can achieve your requirement by using the queryTaskbarInfo event.
Inside this event, you can check the data for start and end dates. If the data does not contain a start and end date, you can set the particular taskbar element visibility to hidden. This will effectively hide the taskbar that does not have start and end dates mapped. You can find the code snippet and sample link below
Code Snippet /*app.component.ts*/ queryTaskbarInfo(args): void { if (!args.data.taskData.StartDate && !args.data.taskData.EndDate) { args.taskbarElement.style.visibility = 'hidden'; } }
|
Sample Link: https://stackblitz.com/edit/angular-yvv5ix?file=src%2Fapp.component.html,src%2Fapp.component.ts,src%2Fdata.ts
We hope this information helps you achieve your desired outcome. Please feel free to reach out to us if you require further assistance.
Regards,
Udhayakumar
Thanks it helped!
And how I can display on the taskbar with dates actually formatted start and end dates? Like this:
I tried #taskbarTemplate with Angular DatePipe but it didn't work for me. I got empty rows instead of any taskbar
Hi Aaron
We have reviewed your query and We would like to suggest an alternative solution that may better suit your needs. Instead of using the #taskbarTemplate, we recommend using the taskLabel template. This template allows you to display the start and end dates of the task using a customized format.
We have attached a sample that demonstrates how to render a taskLabel using a template to display the start and end dates of the task as per your requirements. You can find the code snippet and sample link below
Code Snippet: /*app.component.html*/ <ng-template #labelSettingsTaskLabel let-data> {{ data.StartDate | date: 'dd.MM.yy' }} - {{ data.EndDate | date: 'dd.MM.yy' }} </ng-template> |
Sample Link : https://stackblitz.com/edit/angular-yvv5ix-jeg8wh?file=src%2Fapp.component.html,src%2Fapp.component.ts,src%2Fdata.ts
We hope this solution has answered your query, please let us know if you have any questions regarding this issue
Regards,
Udhayakumar
Thanks I tried this option but unfortunately it doesn't work for me. Maybe I missed some import in component or module (I import GantAllModule)? Seems like to local ng-template let-data variable doesn't come any data - I have empty taskbar labels after applying #labelSettingsTaskLabel template
but at the same time tooltip template which is almost the same works without any problem
Hi Aaron
After reviewing your query, we have attached a sample where we have used all the properties that you have used, but we were unable to replicate the issue. However, we understand that you are still facing the issue, and we would be happy to help you further.
Could you please share the following information to validate further?
Sample Link : https://stackblitz.com/edit/angular-yvv5ix-ewslmm?file=src%2Fapp.component.html,src%2Fapp.component.ts,src%2Fdata.ts
Regards,
Udhayakumar
Hi I reproduced my code in stack blitz and there everything works fine
https://stackblitz.com/edit/angular-yvv5ix-kajwa2?file=src/app.component.html
Could it be the problem with the version? Currently I'm using the following syncfusion packages
Also I remembered that I faced with the same issue earlier and syncfusion team told me that was a bug:
https://github.com/syncfusion/ej2-angular-ui-components/issues/223
I would appreciate any help with this issue
Hi I reproduced my code in stack blitz and there everything works fine
https://stackblitz.com/edit/angular-yvv5ix-kajwa2?file=src/app.component.html
Could it be the problem with the version? Currently I'm using the following syncfusion packages
Also I remembered that I faced with the same issue earlier and syncfusion team told me that was a bug:
https://github.com/syncfusion/ej2-angular-ui-components/issues/223
I would appreciate any help with this issue
Aaron
We have examined your request, but we are unable to execute the sample with the version you have provided. Would you kindly provide the information listed below so that we may further validate it?
Sample Link : https://stackblitz.com/edit/angular-yvv5ix-cl3ddi?file=package.json,src%2Fapp%2Fapp.module.ts
Regards,
Udhayakumar