Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event bars and header height grows after few state re-applying #4401

Open
chuckn0rris opened this issue Mar 23, 2022 · 0 comments
Open

Event bars and header height grows after few state re-applying #4401

chuckn0rris opened this issue Mar 23, 2022 · 0 comments
Labels
bug Something isn't working forum Issues from forum

Comments

@chuckn0rris
Copy link

Forum post

Reproduced in advanced example. Try to call this method many times from console.

 /**
     * Change full gantt view state: columns, gantt.state
     */
     window.setGanttFullState = () => {
        let ganttViewState = {
            "state": {
                "barMargin": 2,
                "rowHeight": 41
            },
            "columns": [
                {
                    "id": "wbs",
                    "type": "wbs",
                    "width": 50,
                    "field": "wbsValue",
                    "hidden": false
                },
                {
                    "id": "name",
                    "type": "name",
                    "width": 250,
                    "field": "name",
                    "hidden": false
                },
                {
                    "id": "startdate",
                    "type": "startdate",
                    "width": 130,
                    "field": "startDate",
                    "hidden": false,
                    "format": "L"
                },
                {
                    "id": "enddate",
                    "type": "enddate",
                    "width": 130,
                    "field": "endDate",
                    "hidden": false,
                    "format": "L"
                },
                {
                    "id": "duration",
                    "type": "duration",
                    "width": 100,
                    "field": "fullDuration",
                    "hidden": false,
                    "format": ""
                },
                {
                    "id": "resourceassignment",
                    "type": "resourceassignment",
                    "width": 120,
                    "field": "assignments",
                    "hidden": false
                },
                {
                    "id": "percentdone",
                    "type": "percentdone",
                    "width": 70,
                    "field": "percentDone",
                    "hidden": false,
                    "format": ""
                },
                {
                    "id": "predecessor",
                    "type": "predecessor",
                    "width": 112,
                    "field": "predecessors",
                    "hidden": false
                },
                {
                    "id": "successor",
                    "type": "successor",
                    "width": 112,
                    "field": "successors",
                    "hidden": false
                },
                {
                    "id": "schedulingmodecolumn",
                    "type": "schedulingmodecolumn",
                    "width": 100,
                    "field": "schedulingMode",
                    "hidden": false
                },
                {
                    "id": "calendar",
                    "type": "calendar",
                    "width": 100,
                    "field": "calendar",
                    "hidden": false
                },
                {
                    "id": "constrainttype",
                    "type": "constrainttype",
                    "width": 146,
                    "field": "constraintType",
                    "hidden": false
                },
                {
                    "id": "constraintdate",
                    "type": "constraintdate",
                    "width": 146,
                    "field": "constraintDate",
                    "hidden": false,
                    "format": "L"
                },
                {
                    "id": "deadlinedate",
                    "type": "deadlinedate",
                    "width": 146,
                    "field": "deadlineDate",
                    "hidden": false,
                    "format": "L"
                },
                {
                    "id": "effort",
                    "type": "effort",
                    "width": 100,
                    "field": "fullEffort",
                    "hidden": false,
                    "format": ""
                },
                {
                    "id": "note",
                    "type": "note",
                    "width": 150,
                    "field": "note",
                    "hidden": false
                },
                {
                    "id": "showintimeline",
                    "type": "showintimeline",
                    "width": 100,
                    "field": "showInTimeline",
                    "hidden": false
                },
                {
                    "id": "sequence",
                    "type": "sequence",
                    "width": 70,
                    "field": "sequenceNumber",
                    "hidden": false
                },
                {
                    "id": "addnew",
                    "type": "addnew",
                    "width": 100,
                    "field": null,
                    "hidden": false
                }
            ]
        }
        if (gantt) {
            if (ganttViewState.state) {
                    gantt.state = {...gantt.state, ...ganttViewState.state}
            }


        if (ganttViewState.columns) {
            gantt.columns.beginBatch()
            let currentColumns = gantt.columns.records.filter((it) => {
                return it.data.type !== "timeAxis"
            })
            gantt.columns.remove(currentColumns)
            gantt.columns.endBatch()
            gantt.columns.add(ganttViewState.columns)
        }
    }
@chuckn0rris chuckn0rris added bug Something isn't working forum Issues from forum labels Mar 23, 2022
@isglass isglass added this to the 5.0.x milestone Mar 23, 2022
@SergeyMaltsev SergeyMaltsev modified the milestones: 5.0.x, 5.1.x Jul 21, 2022
@SergeyMaltsev SergeyMaltsev modified the milestones: 5.1.x, 5.2.x Oct 13, 2022
@isglass isglass removed this from the 5.2.x milestone Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum
Projects
None yet
Development

No branches or pull requests

3 participants