Page 1 of 1

Gantt Project start date

Posted: Wed Mar 01, 2023 8:16 pm
by harshalkhode1703

Hii

Hii
I used this way

<BryntumGantt
    height={props.height}
    ref={props.ganttRef}
    {...props.ganttConfig}
    tasks={props.tasks}
    onFinishCellEdit={props.onFinishCellEdit}
    onTaskDrop={props.onTaskDrop}
    onTaskResizeEnd={props.onTaskResizeEnd}
  /> 
  

Initially takes project start date in right way

initial stage
initial stage
Screenshot from 2023-03-01 23-37-38.png (122.2 KiB) Viewed 3158 times

when moving task to different dates project start date indecator stucks on previous date

dates changed
dates changed
Screenshot from 2023-03-01 23-42-13.png (120.01 KiB) Viewed 3158 times

if i change something it doesn't work.


Re: Gantt Project start date

Posted: Wed Mar 01, 2023 8:35 pm
by marcio

Hey harshalkhode1703,

Could you provide more details regarding your implementation? Perhaps sharing a sample project (getting one of our demos, adding your code, zip it, and sharing it here), would make it a lot faster to assist you on this, because the snippet that you shared doesn't seem to be wrong, so it's probably somewhere else, but we need to see the code to identify what's causing that.


Re: Gantt Project start date

Posted: Thu Mar 02, 2023 9:37 am
by harshalkhode1703

Just added this type object in tasklist
nothing extra.

{
          name: value.name,
          parent_task_id: value.parent_task_id,
          task_status_id: null,
          start_date: moment(value.startDate).format('YYYY-MM-DD'),
          end_date: moment(value.endDate).format('YYYY-MM-DD'),
          assigned_to: '',
          project_id: project?.id,
          duration: value.duration,
        }

and then rendered this

<BryntumGantt
    height={props.height}
    ref={props.ganttRef}
    {...props.ganttConfig}
    tasks={props.tasks}
    onFinishCellEdit={props.onFinishCellEdit}
    onTaskDrop={props.onTaskDrop}
    onTaskResizeEnd={props.onTaskResizeEnd}
  /> 

My gantt config

export const ganttConfig: BryntumGanttProps = {
  viewPreset: { base: 'weekAndDay', tickSize: 60 },
  columns: [
    { type: 'name', width: 250 },
    { type: 'startdate', width: 120 },
    { type: 'duration', width: 100 },
    { type: 'enddate', width: 120 },
  ],
};

Re: Gantt Project start date

Posted: Fri Mar 03, 2023 6:34 am
by arcady

The project start date is a fixed value based of which all tasks dates are calculated.
So it's meant to be provided and if it's not then the Engine calculates it based on the data but that calculation happens only once.


Re: Gantt Project start date

Posted: Tue May 16, 2023 6:28 am
by harshalkhode1703

please look into that and provide any fix as soon as possible


Re: Gantt Project start date

Posted: Tue May 16, 2023 6:38 am
by arcady

Look into what? The project start date is a fixed value. This is not a bug this is by design.


Re: Gantt Project start date

Posted: Tue May 16, 2023 7:02 am
by harshalkhode1703

but it should be refreshed on task date changes.
on refresh of page its changing automatically. if that is design then it should not change on page refresh.


Re: Gantt Project start date

Posted: Tue May 16, 2023 7:36 am
by arcady

but it should be refreshed on task date changes.

If you mean the project start should be refreshed on task date changes then the answer is no. At least out of the box. Your application can implement some other behaviour.

on refresh of page its changing automatically. if that is design then it should not change on page refresh.

That means you don't save project start date changes to the server.


Re: Gantt Project start date

Posted: Tue Aug 29, 2023 6:11 pm
by ivangs

Hi arcady,
I am running into similar problem. If a user drags a task before current project start date, I want to rather move the project start date, than deny the task drag change. Is there a setting to enable this behavior with manuallyScheduled === false?

Thank you,
Ivan


Re: Gantt Project start date

Posted: Tue Aug 29, 2023 6:30 pm
by tasnim

Hi,

You could achieve it something like this

    listeners : {
        beforeTaskDropFinalize(props) {
            const { context, source : gantt } = props;
            if (DateHelper.compare(gantt.project.startDate, context.startDate) === 1) {
                context.valid = false;
                gantt.project.startDate = context.startDate;
            }
        }
    },

https://bryntum.com/products/gantt/docs/api/Core/helper/DateHelper#function-compare-static
https://bryntum.com/products/gantt/docs/api/Gantt/feature/TaskDrag#event-beforeTaskDropFinalize