Our state of the art Gantt chart


Post by daniel.piret »

Hello

We are trying to add a new column in the assignation tab (Resources), unfortunately the column does not reflects the value properly, please check the attached gif.

In order to implement this we created an Assignment class (attached) and referenced the columns in the app.js file, but as you can see when you type the value it does not reflect the value when losing focus, the value is there but it's not displayed. This is reproduced with the gantt-5.0.6 version with the 2 files attached (Assignment will go to the examples/advanced/lib folder and app.js in the examples/advanced)

The expected behavior is that you type 20 in the effort column and when the user changes focus the value is still displayed as 20, not as blank.

Thanks as usual for your help

(Updated the gif as it was cutting and not showing the error)

Attachments
errorBryntum.gif
errorBryntum.gif (16.81 MiB) Viewed 183 times
app.js
(4.91 KiB) Downloaded 35 times
Assignment.js
(501 Bytes) Downloaded 39 times

Post by arcady »

Your field setters do not call model set method and thus the grid store doesn't trigger an event signalizing that the change happened.
So it'll start working If you comment out all Assignment model lines except the new field declaration in fields getter.
Or alternatively your setters should call this.set('field', value) ..that would also fix the code.

BTW effort field will appear soon on assignment model (in v5.1.0 supposedly). It was added while making the task split feature. Yet it's a purely calculated field there which is not editable so far. So you probably better to pick some other name to not overlap with that field. Something like this for example:

class Assignment extends AssignmentModel {

    static get fields() {
        return [
            { name : 'work', type : 'int' }
        ];
    }

    set work(v) {
        this.set('work', v);
    }

    setWork(v) {
        this.set('work', v);
    }

    getWork() {
        return this.get('work');
    }

    get work() {
        return this.get('work');
    }
}

Post Reply