Our state of the art Gantt chart


Post by brian.cronin »

In our implementation, we've observed unexpected behavior when filtering vendor resources. Internal resources consistently function as expected, while the external resource filter occasionally fails to display resources, even when they are available. For example, in the attached video, initially, when attempting to assign an external vendor, no resources were displayed despite one being available. After saving the schedule, the filter began to function correctly. However, the filter stops working completely at any point.

Below is a snippet of the relevant code:

gantt.on('startCellEdit', (editorContext) => {
      if (editorContext.editorContext.column.type == 'resourceassignment') {
        let contractorId = editorContext.editorContext.record._data.contractorId;
        editorContext.editorContext.editor.inputField.picker.onShow = ({ source }) => {
          source.store.filter(record => (record.resource.type == 'Internal Resources' || record.resource.contractorId == contractorId));
        };
      }
    });

Post by tasnim »

Hi,

Can't see the video uploaded here though, Could you please try to upload that reproduction video here again so we can see the issue and understand it properly?


Post by brian.cronin »

Hi,

I am having some issues attaching video, so here is the one-drive link to that video.

https://1drv.ms/v/s!AkOkR9gshBA_gQ8KCcAFW3Jr8w5w


Post by alex.l »

Hi,

I watched the video, but I can't understand what's going on. Could you please describe what's going on step by step and let us know how to reproduce this.

Thank you!

All the best,
Alex


Post by Animal »

Every time you show, you add a filter.

Screenshot 2024-02-26 at 12.55.34.png
Screenshot 2024-02-26 at 12.55.34.png (28.33 KiB) Viewed 171 times

Post by Animal »

And every time you start the edit, you replace the onShow with another onShow. You have to parse and mentally execute the code you write.


Post by brian.cronin »

I had encountered the same issue earlier and received a workaround that seemed to be working until now. However, it appears that the filter is not functioning correctly.

Screenshot 2024-02-26 at 6.55.45 PM.png
Screenshot 2024-02-26 at 6.55.45 PM.png (135.91 KiB) Viewed 158 times

So when I am attempting to filter external resources based on the selected vendor, the filter is not consistently functioning. So how can I prevent calling onShow each time? or should I use any other property for this? If you can show me a brief example, that would be really helpful.

Thanks,


Post by alex.l »

All the best,
Alex


Post by brian.cronin »

Hi,

Yes, clearing the filter before applying it solved the issue.

Thanks!


Post Reply