Hello I have used gantt.updateCollection to update my inline editor select options but it is not reflecting. However, I have noticed that the lightbox select option is updating so I don’t get why it is not working for my inline select editor. This is my columns:
const mainGridConfig = {
columns: [
{
name: "text", label: "Task", width: 150, tree: true,
editor: {type: "text", map_to: "text"}
},
{
name: "status", label: "Status", width: 150, align: "center"
},
{
name: "start_date", label: "Est. Start Date", width: 100, align: "center",
editor: {type: "date", map_to: "start_date", min: new Date(2000, 0, 1), max: new Date(3000, 0, 1)}
},
{
name: "end_date", label: "Est. End date", width: 100, align: "center",
editor: {type: "date", map_to: "end_date", min: new Date(2000, 0, 1), max: new Date(3000, 0, 1)}
},
{
name: "duration", label: "Duration", width: 50, align: "center",
editor: {type: "number", map_to: "duration", min:0, max: 100}
},
{
name: "billable_hours", label: "Billable Hours", width: 100, align: "center",
editor: {type: "number", map_to: "billable_hours", min:0, max: 100}
},
{ name: "owner", label: "Owner", width: 80, align: "center",
template: function (task) {
return byId(gantt.serverList("team"), task.owner_id)
},
editor: {type:"select", map_to:"owner_id", options: gantt.serverList("team")},
},
{ name: "assigned_to", label: "Assigned To", width: 80, align: "center",
template: function (task) {
return byId(gantt.serverList("team"), task.assigned_to)
},
editor: {type:"select", map_to:"assigned_to", options: gantt.serverList("team")},
},
{
name: "instructions", label: "Instructions", width: 150, align: "center",
editor: {type: "text", map_to: "instructions"}
},
// { name: "add", label: "", width: 44 },
]
};
This my lightbox configuration:
gantt.config.lightbox.sections = [
{name: "description", height: 40, map_to: "text", type: "textarea", focus: true},
{name: "billable", height: 40, map_to: "billable_hours", type: "textarea"},
{name: "instructions", height: 40, map_to: "instructions", type: "textarea"},
{name: "owner", height: 40, map_to: "owner_id", type: "select", options: gantt.serverList("team")},
{name: "time", type: "duration", map_to: "auto"},
];
This is my code when getting fresh data:
ganttData(newData) {
this.tasks = [...newData.tasks];
this.links = [...newData.links];
this.resources = [...JSON.parse(JSON.stringify(newData.resources))];
this.team = [...newData.team];
if(this.ganttInitialized) {
gantt.clearAll();
gantt.updateCollection("team", this.team);
gantt.getDatastore("resources").parse(this.resources);
gantt.parse(JSON.stringify({
"tasks": this.tasks,
"links": this.links
}));
}
}