Our state of the art Gantt chart


Post by vdana »

this.getGanttchart()
      .getGantt()
      .on("taskResizeStart", (e: any) => {
        console.log("Resize");
     return e.startClockHtml;
      });

The above code works if i task resizing : console.log("Resize"); it is getting printed.
But not returning e.startClockHtml;
On task resize i want to show only startClockHtml , How to achieve this ?


Post by Maxim Gorkovsky »

Hello.
Where do you get this code from? We do not document such property for this event: https://bryntum.com/products/gantt/docs/api/Gantt/view/GanttBase#event-taskResizeStart Also, this is not how we customize the template. Please see this demo for more info: https://bryntum.com/products/gantt/examples/tooltips/


Post by vdana »

I have gantt in PnGanttchart.ts file where columnLines is false and taskResize and taskDrag is implemented successfully. Now I want to change these gantt properties in other class where it have access of gantt component.

 new Gantt({
     
columnLines: false, features: { taskResize: { // Custom tooltip for when a task is dragged tooltipTemplate: this.onResizeToolTip.bind(this), }, taskDrag: { // Custom tooltip for when a task is dragged tooltipTemplate: this.onResizeToolTip.bind(this), }, } });

In PnProjectGanttChart.ts I have PnGanttchart instance
where i used
ganttInstance.columnLines = true; to make columnLines enabled .
When I use
ganttInstance.features.taskResize.tooltipTemplate It gives me error .

Property 'toolTipTemplate' does not exist on type 'TaskResize'.ts(2339)
How to achive taskResize in PnProjectGanttchart (customized tooltip for task Resize) ?


Post by mats »

So you'd like to change toolTipTemplate at runtime?


Post by vdana »

Yes


Post by alex.l »

Hi vdana,

It cannot be changed at runtime, not supported.
You can check feature availability in a tooltip handler, or use switch/case by some attribute and list all required template cases.

All the best,
Alex Lazarev

How to ask for help? Please read our Support Policy

We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services


Post Reply