search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Set Text in Resource 2nd Columns

Asked by Anonymous
4 years ago.

How we can set description/text on resource's second column on a button click. I
understand on onBeforeResHeaderRender event, I can set description on second
column but need to set dynamically. Below is the code which I am using on button click.

_.forEach(this.ganttTasks, (gt: JobTaskViewModel) => {

let schedulerResource = gt.resource;
let ganttRresource = `${gt.resource}_${gt.sectionNo}`;

const schedulerCostCenter = _.cloneDeep(_.find(this.dpScheduler.resources, (cc: any) => {
return cc.id === schedulerResource && !cc.isHidden;
}));

const ganttCostCenter = _.cloneDeep(_.find(this.ganttCostCenters, (cc: CostCenterViewModel) => {
return cc.id === ganttRresource;
}));

if (schedulerCostCenter) {

if (!ganttCostCenter) {
let title = (gt.sectionNo !== Constants.FINISHING_SECTION ? gt.sectionTitle : 'Finishing') + ':';
schedulerCostCenter.columns[0].html = previousTitle !== title ? title : ''; //(Line where issue is)
previousTitle = title;
schedulerCostCenter.id = ganttRresource;
this.ganttCostCenters.push(schedulerCostCenter);
}

const event = _.find(this.dpScheduler.events.list, (e: DayPilot.EventData) => {
return e.id.toString() === gt.id.toString();
});

if (event) {
gt.resource = ganttRresource;
gt.start = event.start;
gt.end = event.end;
}
}
});

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.