Our powerful JS Calendar component


Post by braincept »

This is our code.
we are catching events in HTML with "onCatchAll".
resourceFIlter is working base on 'trigger' used in function 'setupResourceFilter'

Attachments
New folder.7z
(12.08 KiB) Downloaded 17 times
Last edited by braincept on Wed Mar 29, 2023 1:37 pm, edited 1 time in total.

Post by braincept »

Animal wrote: Wed Mar 29, 2023 12:43 pm

Widgets are reconfigurable all the way down:

Screenshot 2023-03-29 at 12.42.23.png

Thanks for suggestion.
It really helps.


Post by Animal »

Glad the hint helped.

I noticed a few things.

Typo. I assume this should be translationPipe:

Screenshot 2023-03-30 at 07.19.23.png
Screenshot 2023-03-30 at 07.19.23.png (24.81 KiB) Viewed 176 times

These settings are irrelevant in MonthView or AgendaView. They shows whole day cells. These settings are all DayView things (Don't forget that a WeekView is just a multi day DayView):

Screenshot 2023-03-30 at 07.15.20.png
Screenshot 2023-03-30 at 07.15.20.png (50.56 KiB) Viewed 176 times

Here is your bug I think:

Screenshot 2023-03-30 at 07.30.39.png
Screenshot 2023-03-30 at 07.30.39.png (327.56 KiB) Viewed 176 times

You inject a trigger method into the widget. This overrides the broadcasting of events, and therefore disables all event broadcasting.

This will break how filtering works. Nobody can subscribe to its events. Never override the trigger method. Add a listener :

    this.sidebar.items.resourceFilter = {
      type: 'calensoresourcefilter',
      weight: 300,
      selected: {
        values: selectedValues
      },
      multiSelect: true,

      // Listen for the item action
      listeners : {
        item({ source, record }) {
            // Does the resourceFilter (source is the event broadcaster) have this record selected?
            const isSelected = source.selected.includes(record);
        }
      }

I changed it in the example. Notice how the events filter out, but the resource subview stays:

bugged.gif
bugged.gif (682.96 KiB) Viewed 176 times

If you configure the resourceFilter with selectAllItem : true it of course keeps it synced. You do not need to intervene:

selectall.gif
selectall.gif (360.52 KiB) Viewed 176 times

Post by braincept »

First of all thanks for your quick response and I really appreciate the way you provided all the feedbacks.

However, I want to clarify, if I replace resource filter's trigger with listner then possibility to hide/remove resource subview?


Post by Animal »

It obviously does this automatically. See the example: https://bryntum.com/products/calendar/examples/resourceview/

It would be a bad bug on our part if we did not do this.


Post Reply