Skip to content

Task segments should inherit the custom fields from task record #10252

@ghulamghousdev

Description

@ghulamghousdev

Forum Post

Go to gantt basic example: https://bryntum.com/products/gantt/examples/basic/, update the code with the below, split a task and you can see the task segment does not inherit the custom fields.


class Ne extends TaskModel {
    static fields = [
        { name : 'note', persist : true }
    ];
}

new Gantt({
    appendTo          : 'container',
    dependencyIdField : 'sequenceNumber',
    rowHeight         : 45,
    tickSize          : 45,
    barMargin         : 8,
    project           : {
        taskModelClass     : Ne,
        autoSetConstraints : true, // automatically introduce `startnoearlier` constraint if tasks do not use constraints, dependencies, or manuallyScheduled
        autoLoad           : true,
        transport          : {
            load : {
                url : '../_datasets/launch-saas.json'
            }
        }
    },

    columns : [
        { type : 'name', width : 250 },
        {
            field : 'note'
        }
    ],

    // Custom task content, display task name on child tasks
    taskRenderer({ taskRecord }) {
        if (taskRecord.isLeaf && !taskRecord.isMilestone) {
            return StringHelper.encodeHtml(taskRecord.name);
        }
    }
});
Screen.Recording.2024-10-23.at.3.12.30.PM.mov

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingforumIssues from forum

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions