Our powerful JS Calendar component


Post by Animal »

So this is uncovering problems, and I'd like to know how far you have got this to work.

Are you configuring your resourceStore with an initial filter so that only a few resource views are visible?

Because there's a bug right there in that the resource filter in the sidebar doesn't know about that and has all the resources checked.

Screenshot 2021-12-07 at 10.42.38.png
Screenshot 2021-12-07 at 10.42.38.png (60.44 KiB) Viewed 838 times

I have configured that Calendar with

            resourceStore : {
                data : [
                    { id : 1, name : 'Bruce Wayne', image : 'arnold.jpg', eventColor : 'blue', alias : 'Batman' },
                    { id : 2, name : 'Clark Kent', image : 'rob.jpg', eventColor : 'orange', alias : 'Superman' }
                ],
                filters : [{
                    property : 'name',
                    operator : '=',
                    value    : 'Clark Kent' 
                }]
            }

So we only see the view for Clark Kent. You see both are checked in the resource filter list in the sidebar.

Do you see that in your app?

What technique are you then using to show the filtered out resources which then shows them in the wrong order?

Because I have fixed that bug and it now only selects the visible resources, but checking the unchecked one does not show the resource view for it.

How are you showing the other resource view?


Post by Animal »

This is going to be difficult.

If the application puts a filter on the resource store, the resource filter list can't really know.

It can only check the items that are filtered in, but then checking one can't really force that back into the store.

So there's a mismatch between filtering the resource store and using that resource filter list.


Post by Animal »

I have added a fix which makes the order of the resource views always match the order of resources in the ResourceStore.

I hope that is correct.


Post by Animal »

I've added a new config:

Screenshot 2021-12-07 at 16.29.53.png
Screenshot 2021-12-07 at 16.29.53.png (59.9 KiB) Viewed 836 times

I think this is what you are asking for.

Now we have two modes. The default, in which the views are in a stable position with respect to where the corresponding resource is in the resource store.

So if you have A,B,C,D,E, and you filter out C, then filter it back in, it will again look like A,B,C,D,E

And then there's stableResourceOrder : false.

This will mean that if you have A,B,C,D,E, and you filter out C, then filter it back in, it will again look like A,B,D,E,C

So it's whichever way round you want now.

Before we commit this to the repo and close the ticket, will this cover your use case?


Post by longevo-florian »

Hi animal,

thanks for your support.

We tried to integrate your solution, but unfortunately it doesn't solve our problem.

As you can see in the video below (check the link), if I select user A,B,C then I unselect user C, I go back two weeks in the calender and I select user C again -> the bug is that you are still caching the previous week with the user C

https://drive.google.com/file/d/1NhlnXfWh09bNQjtuN35zGNJDW1kdFag7/view?usp=sharing

Can you help us solving it?

Thanks


Post by mats »

Can you please share a runnable small test case so we can reproduce it?


Post by Animal »

Yes, I have reproduced the issue that if you filter a view back in after you have moved to a different date, it still shows the events for the date it was last shown at.

I can create a ticket for that. https://github.com/bryntum/support/issues/3893

That flickering at the end of your video, what was that? I don’t see that when I reproduce this error (which you can reproduce in the online example)


Post by longevo-florian »

Hi, we invited you to Github

https://github.com/poettl/longevo-bryntum-support

The flickering bug is happening because the time is changing all the time and we refresh for each time change.


Post by Animal »

OK, it was a very simple misstep on my part. The override for the ResourceView class is

    updateDate(date) {
        // Inhibit any refreshes during multiple subview updates
        this.suspendVisibility();

        // Keep *all* views in sync, not just visible ones. <===== not just the visible "items"
        this.viewCache.forEach(v => {
            // We must skip the time axis and scroller that are added to handle Day/Week view scrolling
            if (!v.isResourceDayViewTimeAxis) {
                v.date = date;
            }
        });

        // Trigger one round of refreshes.
        this.resumeVisibility();
    }

This will be in the next release.


Post Reply