Our state of the art Gantt chart


Post by kamran_mushtaq »

I have attached the picture you can see the start data is in it is 29 for all the tasks. I can change the end date as well as the percentage Complete but when I change the start date It goes back to the 29th data always can you please let me know what is this issue.

	const gantt = new Gantt({
			appendTo : 'gantt_chart',
			// resourceImageFolderPath : "/common/images/bryntumGantt/resourceAvatar",
			// startDate : new Date(),
			// endDate   : new Date(),

		project : {
      		taskModelClass : Task,
            dependencyModelClass : MyDependencyModel,

        taskStore : {   
            listeners : {
                change : (data) => {
                    console.log('data1234 tast data changes', data, data.changes);
                    console.log('data1234 Task data records', data, data.records);

                    if (data.action === 'add') {
                        taskStoreDataAdd(data.records);
                    }

                    if (data.action === 'update') {
                        taskStoreDataUpdate(data.records);
                    }
                }
            }
        },

        dependencyStore : {
            listeners : {
                change : (data) => {           
                    
                    if (data.action === 'add') {
                       
                        dependencyStoreDataAdd(data.records);
                    }
                   
                    if (data.action === 'remove') {
                        console.log('Dependency records', data.records);
                        dependencyStoreDataRemove(data.records);
                    }
                    
                }
            }
        }

		},

		features: {
			percentBar: true,

            pdfExport : {
                exportServer: 'https://dev.bryntum.com:8082',
                headerTpl,
                footerTpl
            },
            taskTooltip : {
                template(data) {
                    const me = this,
                    { taskRecord } = data;
                   
                    return TaskTooltip.defaultConfig.template.call(me, data) +
                        `<table border="0" cellspacing="0" cellpadding="0">
                            <tr><td>${me.L('Status')}:</td><td>${taskRecord.status_name}</td></tr>
                            <tr><td>${me.L('Assignee')}:</td><td>${taskRecord.assignee_name}</td></tr>
                        </table>`;
                }
            },

		},
        
        tbar : [
            {
                type : 'button',
                ref  : 'exportButton',
                icon : 'b-fa-file-export',
                text : 'Export to PDF',
                onClick() {
                    gantt.features.pdfExport.showExportDialog();
                }
            }
        ],

		columns : [
			{ type : 'name', width : 130 },
			{ type : 'startdate' },
			{ type : 'enddate' }, 
			
		],

		taskRenderer({ taskRecord }) {
			if (taskRecord.isLeaf && !taskRecord.isMilestone) {
				return StringHelper.encodeHtml(taskRecord.name);
			}
		}	
	});
	
	
	       gantt.project.inlineData = {
		tasksData : tasks.data, 

		dependenciesData  : tasks.links,
    

		resourcesData : [
			{ id : 12, name : 'Arcady', company: 'jinTech' },
			{ id : 14, name : 'Don' , company: 'ABC'}
			
		],
		assignmentsData : [
			{ 'event' : 12, 'resource' : 12 },
			{ 'event' : 24, 'resource' : 14 }
		]

	};
Attachments
Screenshot 2022-10-04 kk.png
Screenshot 2022-10-04 kk.png (101.77 KiB) Viewed 406 times

Post by arcady »

Start/end dates are calculated values for automatically scheduled tasks.
The values are calculated based on task dependencies and constraints.

So if you want an unconstrained task to start not earlier than a certain date please use corresponding constraints:

{
    "startDate" : "2022-10-04",
    "constraintType" : "startnoearlierthan",
    "constraintDate" : "2022-10-04",
    ...
}

More details on tasks scheduling can be read here: https://www.bryntum.com/docs/gantt/guide/engine/gantt_events_scheduling#automatic-event-scheduling


Post by kamran_mushtaq »

Hi Arcady,
Actually start data is fixed in my Gantt Chart I want to unfix it so that I can change start data by drag and drop or simple by changing it through the column. Everything else is changing and saving its new value but start data is not saving its new value and fixed to one specific data (for every task).


Post by arcady »

Do you mean project startDate is not sent when you change it?


Post by kamran_mushtaq »

Yes, if I have 8 tasks with different startDate and end dates end data will be shown different in Gantt view for every task but startDate is of every task is fixed to the one specific date. Like I mentioned above in screen shot these tasks have different startdate when I created them but now showing same startDate for all.


Post by arcady »

Please provide a runnable test case or exact steps how we can reproduce the issue on some of our examples.


Post by kamran_mushtaq »

I have dropped the code above can you please check.


Post by kamran_mushtaq »

Project starting from 29 SEP and all tasks sticks to that regardless of different start dates


Post by arcady »

I have dropped the code above can you please check.

We need a runnable test case not a fragment.

Project starting from 29 SEP and all tasks sticks to that regardless of different start dates

Already replied that here: viewtopic.php?p=111355#p111355


Post by kamran_mushtaq »

Project starting from 29 SEP and all tasks sticks to that regardless of different start dates

Already replied that here: viewtopic.php?p=111355#p111355
[/quote]

But I need an opposite to it I want my tasks to be flexible if there is no dependency then they can be changes and can have different start date. Don't want a fix startDate for every task.


Post Reply