Page 1 of 2

[REACT]gantt image auto shrink

Posted: Tue Apr 04, 2023 12:24 pm
by yqchen

1、This is the data interface that I initialized
Image

2、I right-click to open the edit popover, do nothing, and click the Cancel button to close the popover
Image

Image

3、The width of new1 on the chart is automatically reduced. Why is this? Can you turn off the setting for automatic width reduction?


Re: [REACT]gantt image auto shrink

Posted: Tue Apr 04, 2023 1:14 pm
by tasnim

Hi,

Your image isn't loaded so I can't see it. You could try dragging and dropping the image in the text box
And please provide your code snippet so we could reproduce it.


Re: [REACT]gantt image auto shrink

Posted: Tue Apr 04, 2023 1:20 pm
by yqchen

I'm sorry, I don't know why my picture can't be loaded out, I directly give my picture link address to try to access it

Picture 1: https://github.com/757268590/git-cycq/blob/master/1.png

Picture 2: https://github.com/757268590/git-cycq/blob/master/2.png

Picture 3: https://github.com/757268590/git-cycq/blob/master/3.png


Re: [REACT]gantt image auto shrink

Posted: Tue Apr 04, 2023 1:39 pm
by tasnim

Hi,

Could you please provide the data here that you're using to reproduce it? so it would be easy for us to reproduce and investigate.


Re: [REACT]gantt image auto shrink

Posted: Tue Apr 04, 2023 1:47 pm
by yqchen
{
	"userId": null,
	"companyId": null,
	"compoundProjectBigId": null,
	"baselineId": "1643190732050440194",
	"baseline": null,
	"isCurrent": 2,
	"currentBaseline": 2,
	"tasks": [{
		"id": "_generatedClassDefEx_30a02a5e-bbc6-49a1-a868-14e10be96b14",
		"name": "new1",
		"idTemp": "1643190732066000896",
		"parentIndex": 0,
		"percentDone": "0.00",
		"percent": null,
		"duration": 1,
		"startDate": "2023-04-01T23:59:59+08:00",
		"endDate": "2023-04-02T00:00:00+08:00",
		"color": null,
		"cost": null,
		"type": null,
		"parentId": null,
		"baselineItemId": "1643190732067217410",
		"baselines": [{
			"duration": 0,
			"startDate": "",
			"endDate": "",
			"baselinesId": "1642135057031499777"
		}, {
			"endDate": "2023-04-02T23:59:59+08:00",
			"baselinesId": "1642135057031499777",
			"modifyFiles": [],
			"duration": 1,
			"createTime": "2023-04-01 20:01:33",
			"startDate": "2023-04-01T23:59:59+08:00"
		}, {
			"endDate": "2023-04-02T00:00:00+08:00",
			"baselinesId": "1643190732050440194",
			"duration": 1,
			"startDate": "2023-04-01T23:59:59+08:00"
		}],
		"children": [],
		"expanded": true,
		"constraintType": "startnoearlierthan",
		"constraintDate": "2023-04-01T23:59:59+08:00",
		"isKey": 0
	}, {
		"id": "_generatedClassDefEx_0d7b9ff3-9f65-4c80-8d43-ee2ef01ea7cf",
		"name": "new2",
		"idTemp": "1643190732066000897",
		"parentIndex": 1,
		"percentDone": "0.00",
		"percent": null,
		"duration": 1,
		"startDate": "2023-04-01T23:59:59+08:00",
		"endDate": "2023-04-02T23:59:59+08:00",
		"color": null,
		"cost": null,
		"type": null,
		"parentId": null,
		"baselineItemId": "1643190732067217411",
		"baselines": [{
			"duration": 0,
			"startDate": "",
			"endDate": "",
			"baselinesId": "1642135057031499777"
		}, {
			"endDate": "2023-04-02T23:59:59+08:00",
			"baselinesId": "1642135057031499777",
			"duration": 1,
			"startDate": "2023-04-01T23:59:59+08:00"
		}, {
			"endDate": "2023-04-02T23:59:59+08:00",
			"baselinesId": "1643190732050440194",
			"duration": 1,
			"startDate": "2023-04-01T23:59:59+08:00"
		}],
		"children": [],
		"expanded": true,
		"constraintType": "startnoearlierthan",
		"constraintDate": "2023-04-01T23:59:59+08:00",
		"isKey": 0
	}, {
		"id": "567348389386297344",
		"name": "new3",
		"idTemp": "1643190732066000898",
		"parentIndex": 2,
		"percentDone": "0.00",
		"percent": null,
		"duration": 1,
		"startDate": "2023-04-01T23:59:59+08:00",
		"endDate": "2023-04-02T23:59:59+08:00",
		"color": null,
		"cost": null,
		"type": null,
		"parentId": null,
		"baselineItemId": "1643190732071411713",
		"baselines": [{
			"duration": 0,
			"startDate": "",
			"endDate": "",
			"baselinesId": "1642135057031499777"
		}, {
			"endDate": "2023-04-02T23:59:59+08:00",
			"baselinesId": "1642135057031499777",
			"duration": 1,
			"startDate": "2023-04-01T23:59:59+08:00"
		}, {
			"endDate": "2023-04-02T23:59:59+08:00",
			"baselinesId": "1643190732050440194",
			"duration": 1,
			"startDate": "2023-04-01T23:59:59+08:00"
		}],
		"children": [],
		"expanded": true,
		"constraintType": "startnoearlierthan",
		"constraintDate": "2023-04-01T23:59:59+08:00",
		"isKey": 0
	}],
	"workingDay": 5,
	"dependencies": null,
	"baselinesIdList": ["1642135057031499777", "1642887503060180994", "1643190732050440194"]
}

Re: [REACT]gantt image auto shrink

Posted: Tue Apr 04, 2023 1:48 pm
by yqchen
<>
          <BryntumProjectModel
            ref={(ref) => {
              .......
            }}
            calendar={workingDay}
            tasks={tasks}
            dependencies={dependencies}
          />
          <BryntumGantt
            tbar={{ items: tBarItems }}
            project={project}
            ref={ganttComponent}
            {...ganttConfig}
            readOnly={false}
          />
        </>

Re: [REACT]gantt image auto shrink

Posted: Tue Apr 04, 2023 1:53 pm
by yqchen
export const ganttConfig = {
  emptyText: '',
 
  dependencyIdField: 'wbsCode',
  
columns: [ { type: 'wbs' }, { type: 'name', field: 'name', text: 'name' }, { type: 'percentdone', text: '%', showCircle: true, width: 70, align: 'center' }, { type: 'predecessor', text: 'predecessor' }, { type: 'successor', text: 'successor' }, { type: 'startdate', text: 'startdate', format: 'YYYY-MM-DD' }, { type: 'duration', text: 'duration' }, { type: 'enddate', text: 'enddate', format: 'YYYY-MM-DD' }, { field: 'ex', renderer: () => '', editor: false }, ], subGridConfigs: { locked: { flex: 8, }, normal: { flex: 2, }, }, columnLines: true, rollupsFeature: { disabled: true, }, progressLineFeature: { disabled: true, statusDate: new Date(2019, 0, 25), }, filterFeature: true, dependencyEditFeature: false, timeRangesFeature: { showCurrentTimeLine: true, }, labelsFeature: { left: { field: 'name', editor: { type: 'textfield', }, }, }, baselinesFeature: { // Custom tooltip template for baselines disabled: true, template(data) { ...... }, },
taskEditFeature: { items: { resourcesTab: false, advancedTab: false, notesTab: false, }, }, taskMenuFeature: { items: { // editTask: false, editTask: { text: 'edit', }, cut: { text: 'cut', }, paste: { text: 'paste', }, copy: { text: 'copy', }, deleteTask: { text: 'deleteTask', }, add: { text: 'add', cls: 'b-separator', icon: 'b-icon-add', weight: 500, menu: { subtask: { text: 'subtask', weight: 540, icon: 'b-icon-subtask', at: 'end', onItem({ taskRecord }) { window.gantt.current.instance.addSubtask(taskRecord, { at: this.at, data: { id: snowflake.generate(), name: 'new', }, }); }, }, ....... }, }, filterDateEquals: false, filterNumberEquals: false, filterStringEquals: false, indent: false, outdent: false, convertToMilestone: false, splitTask: false, linkTasks: false, unlinkTasks: false, filterNumberLess: false, filterNumberMore: false, }, }, };

Re: [REACT]gantt image auto shrink

Posted: Wed Apr 05, 2023 9:36 am
by alex.l

Hi, thank you for the report. I've reproduced this in our examples using data you provided.
We need to investigate this deeply to understand what's the problem. I've opened ticket here https://github.com/bryntum/support/issues/6534


Re: [REACT]gantt image auto shrink

Posted: Wed May 17, 2023 8:08 am
by nickolay

@yqchen Hi, I can't reproduce this issue using the latest code. Can you please confirm it was fixed on your end?


Re: [REACT]gantt image auto shrink

Posted: Tue Jun 06, 2023 6:55 am
by nickolay

@yqchen Any updates?