The part which is not clear is: how can we use listItemTpl and achieve the below change:
When we click on the predecessor dropdown the list of value currently shows Name(WBS order), can we change this to show start date(Name)
Support Forum
- Attachments
-
- predecessor lov
- predecessor list of value.png (39.86 KiB) Viewed 273 times
Hi, here is an example
columns : [
// ...
{
type : 'predecessor',
width : 112,
editor : {
listItemTpl(task) {
const
taskName = StringHelper.encodeHtml(task.name),
taskStartDate = DateHelper.format(task.startDate, 'YYYY-MM-DD'),
{ dependencyIdField } = this.owner;
return `<div class="b-predecessor-item-text">${taskStartDate} (${taskName})</div>
<div class="b-sch-box b-from" data-side="from"></div>
<div class="b-sch-box b-to" data-side="to"></div>`;
}
}
},
All the best,
Alex
Hey sprabhu,
Have you added the import to the StringHelper?? If you add it, you'll get it working correctly.
- Attachments
-
- Screenshot 2023-06-13 at 13.30.20.png (52.27 KiB) Viewed 234 times
-
- Bryntum Gantt - Advanced demo - 13 June 2023.mp4
- (193.24 KiB) Downloaded 31 times
Best regards,
Márcio
Hi,
You could achieve it using a renderer method on the column
renderer({ record }) {
if (record.predecessors.length > 0) {
const result = record.predecessors.map(dependency => DateHelper.format(dependency.toTask.startDate, 'YYYY-MM-DD'))
return result.join(';')
}
}
- Attachments
-
- Screenshot 2023-08-15 111521.png (50.44 KiB) Viewed 186 times