Im having trouble customizing the two tabs, when creating a predecessor or a sucessor u can choose an event in a list, but this list display the name of the event and the id, i wanted to display a custom field named chapterNumber that i created, but i just couldnt find the right way to do it. is there a way to change this?
You can do it in the following mannger, just return whatever you want from the listItemTpl:
features : {
taskEdit : {
// Customize its contents
items : {
predecessorsTab : {
items : {
grid : {
columns : {
// Columns are held in a store, thus it uses `data`
// instead of `items`
data : {
name : {
// Change header text for the name column
editor : {
listItemTpl(event) {
const
me = this,
dependencyTab = me._dependencyTab ||
(me._dependencyTab = me.up('dependencytab', true)),
{ dependencyIdField } = dependencyTab,
id = (event.hasGeneratedId && dependencyIdField === 'id')
? null : event[dependencyIdField];
// only consider hasGeneratedId if dependencyIdField === 'id' because if
// dependencyIdField === 'wbsCode', we want to show that (and most likely
// any field other than "id")
return StringHelper.xss`${event.name}${(id != null) ? ` (${id})` : ''}`;
}
}
}
}
}
}
}
},
}
}
},
Similarly you can do it for the successors tab as well.
Thanks alot, that worked pretty well.
Well, i got another problem related to it, well after i set the list to the values i want now i want to display it so i did this way :
The problem is that this way is indeed displaying the value but if i try to create another predecessor i get an error on the rendering, where it can find the value im trying to display, so, am i using the renderer in a wrong way?
You sure that event.value.chapterNumber exists? Please check the console for errors and if nothing helps please share how we can reproduce this in this demo here: https://bryntum.com/products/gantt/examples/advanced/