Our state of the art Gantt chart


Post by MauriceLapre »

Hi,

I'd like to add an editable colum to the Resources tab in the TaskEditor. I've extended the AssignmentModel class to add custom fields to assignments, e.g. a scheduled date-field. The demo about manipulating the TaskEditor is about adding fields, removing tabs and adding a custom tab. But would it also be possible to manipulate the Resources grid?

Thank you.

Post by mats »

Nice request! Not yet supported but should be reasonably easy to add, ticket opened: https://github.com/bryntum/support/issues/229

Post by MauriceLapre »

Alright, sounds good!
In the mean time, would creating a custom tab with custom grid fetching assignment data be possible?

Post by mats »

Sure, look at our task editor example + docs for instructions on how to extend the task editor with extra tab. https://www.bryntum.com/examples/gantt/taskeditor/

Post by MauriceLapre »

Hi,

So, I've created a custom "Resources" tab, extending the ResourcesTab class. This is working nicely.
I'm also filtering the Resources dropdown (the chained Resources store) on loadEvent after it's created from the master Resources store. For example, to only show Resources of city "Barcelona".
resourceCombo.store.filter({
            property : 'city',
            value    : 'Barcelona',
            operator : '='
        });
This works, only resources with city is "Barcelona" are shown in the Resources dropdown.

When a resource with a different city has already been assigned, this record is shown normally. But, when I start editing the Resource field and leave it again without changing anything (so cancel the edit), the assignment record is being removed.

I thought it might be this part causing it, but it's not getting to the remove part:
onGridCancelCellEdit() {
        if (this._editingAssignment) {
            if (!this._editingAssignment['resource']) {
                this._editingAssignment.remove();
            }

            this._editingAssignment = null;
        }
    }
I don't want that resource to be removed, I just want to accomplish that new assignments cannot be added with filtered out resources.

Any help would be appreciated. Thank you!

Post by sergey.maltsev »

Hi!

Could you please attach a sample code for this so it would be easily checked?
It would be perfect if you could use any of our demos for this.

And please append exact steps to see the problem.

Post by MauriceLapre »

Hi,

I've created some sample code based on the TaskEditor customization demo. Created a custom tab Resources and applying the filter in the LoadEvent trigger.

You can see on task "Configure firewall" Celia and Gloria are assigned. Gloria's city is not Barcelona. When you doubleclick on the resource column to edit you can see the filter is working as her name is not in the dropdown list. But don't change it and just cancel the edit, leave the TaskEditor and open it again, and Gloria has been removed...
Attachments
app.module_2.js
(11.05 KiB) Downloaded 113 times

Post by sergey.maltsev »

Hi!
As you know I've have opened this issue on your previous TaskEdit request.
https://github.com/bryntum/support/issues/272
This seems the same problem with filtering in TaskEdit.

Please subscribe to this issue to get updates and check your workflow after this fix is out.
Most recent updates are always available in Nightly builds in Customer Zone.

Post Reply