Our powerful JS Calendar component


Post by braincept »

Hi Team,

We are facing one issue in bryntum calendar sidebar resourceFilter.

Please have a look at the screenshot. We are trying to select particular resources on page load in resourceFilter but we are not sure how to do that.

	sidebar: {
		items: {
			resourceFilter: {
			}
		}
	}

We are not able to configure resourceFilter. If you have any example, please share with us so that we can implement the resourceFilter in the sidebar.

We have tried to add load listeners also but listeners are also not working. Maybe I am doing something wrong.

Attachments
Screenshot 2021-01-08 at 2.41.02 PM.png
Screenshot 2021-01-08 at 2.41.02 PM.png (80.26 KiB) Viewed 1482 times

Post by Animal »

It is possible.

Go to https://www.bryntum.com/examples/calendar/basic/

And add the following to the config of the Calendar there:

sidebar : {
    items : {
        resourceFilter : {
            selected : {
                values  : [{ id : 'bryntum' }]
            },
            initFilter() {
                this.onSelectionChange({ source : this.selected, removed : [], added : [] });
            }
        }
    }
},

But we need a better solution. I think there is a ticket. I will try to find it and see if we can up its priority.


Post by Animal »

This is the ticket for you to track: https://github.com/bryntum/support/issues/2006


Post by braincept »

Hi Animal,

The selection solution is working. We are able to select predefined resources. But now we are facing one more issue.
Please have a look at the GIF file.

Resources are successfully loaded. Events are successfully loaded. But when we are trying to uncheck one resource then we have to uncheck it twice.
Steps:
1) Uncheck the resource
2) Check the resource
3) uncheck the resource again.

Then we can see the changes in the calendar.

Attachments
captured.gif
captured.gif (12.1 MiB) Viewed 1472 times

Post by pmiklashevich »

Hello!

Do you use the code @Animal gave to you above?

sidebar : {
    items : {
        resourceFilter : {
            selected : {
                values  : [{ id : 'bryntum' }]
            },
            initFilter() {
                this.onSelectionChange({ source : this.selected, removed : [], added : [] });
            }
        }
    }
},

I've tried this code in our Basic demo and I see no issues with selecting/deselecting the filter. Resources are filtered by the first click as expected. Could you please submit a testcase showing your issue?

Best,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post by braincept »

Thanks Pavel, it worked! Feel free to close this thread.


Post by Animal »

Hi Braincept, you'll be happy to know (as will all the other people who reported this bug) that now (next release - 5.0.2) you can simply use

    sidebar : {
        items : {
            resourceFilter : {
                // Initially select resource IDs 1 and 4
                selected : [1, 4]
            }
        }
    },
Screenshot 2022-03-24 at 17.52.21.png
Screenshot 2022-03-24 at 17.52.21.png (50.56 KiB) Viewed 779 times

Post Reply