Our powerful JS Calendar component
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 (80.26 KiB) Viewed 1485 times
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.
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 (12.1 MiB) Viewed 1475 times
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
Thanks Pavel, it worked! Feel free to close this thread.
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 (50.56 KiB) Viewed 782 times