Discuss anything related to web development but no technical support questions


Post 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 2603 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 2603 times

if i change something it doesn't work.


Post 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.

Best regards,
Márcio


Post 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 },
  ],
};

Post 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.


Post by harshalkhode1703 »

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


Post by arcady »

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


Post 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.


Post 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.


Post 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


Post 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

Attachments
chrome_x8zxjW1NQc.gif
chrome_x8zxjW1NQc.gif (761.42 KiB) Viewed 1598 times

Post Reply