Our state of the art Gantt chart


Post by bharat95 »

Hi,

I want to refresh gantt after adding new task. I'm using react typescript.

Thanks,
Bharat


Post by Animal »

Adding a TaskModel to a Gantt's TaskStore will refresh the Gantt. You do not need to do anything if you are adding a new task.


Post by bharat95 »

But still I want to refresh gantt. How can I do ?


Post by alex.l »

All the best,
Alex


Post by bharat95 »

Hi

I want to refresh row after addTaskAbove in below code. I'm using react type script.

add: {
          menu: {
            milestone: false,
            addTaskAbove: {
              text: 'Deliverable above',
            },
            addTaskBelow: {
              text: 'Deliverable below',
            },
            subtask: {
              text: 'Activity',
            },
          },

Post by alex.l »

The code I provided is correct to refresh Gantt in all frameworks. But actually you should not be needed to refresh Gantt after any add/remove records operation, as Animal already mentioned.
If your question is how to catch the moment of adding new task to run refresh, then the answer is: you can subscribe on TaskStore's add event.
https://bryntum.com/products/gantt/docs/api/Gantt/data/TaskStore#event-add
If you don't know how to add listeners, I would recommend you to check our examples for React, and review our guides for React
https://bryntum.com/products/gantt/docs/api/guides-integration-react

All the best,
Alex


Post by bharat95 »

Hi,
The problem I'm facing while adding a task is when I add a task and edit the same added task. 2 task are getting added. If I manually refresh after adding the task, it is working properly. Please help me with it.

Thanks,
Bharat


Post by alex.l »

Hi, sure! Please attach runnable application and provide steps to reproduce the issue, we will debug and find the root cause.

All the best,
Alex


Post by bharat95 »

Hi,

I can't share my code. Can you please share code like how can i refresh gantt rows after task got added in react using typescript?

Thanks,
Bharat


Post by bharat95 »

Hi,

The action method UpdateGanttData is getting called twice when i'm adding new task. Please find the attached code:

sync: {
        url: '/Layout/ProjectTimeView/UpdateGanttData',
        method: 'POST',
        params: {
          projectId: null,
        },
      },

Please help me with it.

Thanks,
Bharat


Post Reply