[VUE 2] How to prevent resourceField from rendering readOnly resources?
Posted: Thu Oct 06, 2022 12:11 am
by ilyaskohistani
Hi, It's first time using Bryntum calendar. When using bryntum calendar i have resources that are read only. but when i update an event or i want to add a new event i can see those resources in Calendar field of eventEdit. how to not show these resources in eventEdit but keep them in filter events left sidebar. You can see it on image as well.
Re: [VUE 2] How to prevent resourceField from rendering readOnly resources?
Posted: Thu Oct 06, 2022 8:57 am
by Animal
You can configure everything in the editor all the way down.
In this case, you'd need to configure your calendar features like this:
// Features named by the properties are included.
// An object is used to configure the feature.
features : {
eventEdit : {
editorConfig : {
// We are augmenting the configuration of the editor's child items - its widgets
items : {
// We are augmenting the configuration of the resourceField
resourceField : {
// We are augmenting the configuration of the store
store : {
filters : [{
property : 'id',
value : 'bryntum'
}]
}
}
}
}
}
}
When I set up the "Basic" example with that, I get this:
Screenshot 2022-10-06 at 08.53.04.png (103.39 KiB) Viewed 532 times
So in addition to simple filters which filter on a property name and a value, you can specify a filterBy function which takes the record and returns true or false to decide whether to filter it in or out.
Re: [VUE 2] How to prevent resourceField from rendering readOnly resources?
Posted: Thu Oct 06, 2022 9:20 am
by Animal
The filters configuration on the Store isn't very clear. I'll fix it to look like this in the next release:
Screenshot 2022-10-06 at 09.19.09.png (94.29 KiB) Viewed 532 times
Re: [VUE 2] How to prevent resourceField from rendering readOnly resources?
Posted: Thu Oct 06, 2022 7:00 pm
by ilyaskohistani
I tried all the ways you have mentioned and yet i see the same result. I have also attached my code example. I have tried all properties with this filter but no result at all.
Re: [VUE 2] How to prevent resourceField from rendering readOnly resources?
Posted: Thu Oct 06, 2022 8:11 pm
by mats
I assume you'd want to only keep the non-readOnly resources?
filters : [{
property : 'readOnly',
value : false
}]
Re: [VUE 2] How to prevent resourceField from rendering readOnly resources?
Posted: Thu Oct 06, 2022 10:28 pm
by ilyaskohistani
Yes, But no matter what property and value i set here it does not affect the result. it always show me all the resources. tried name, id, readOnly, eventColor nothing is working.
Re: [VUE 2] How to prevent resourceField from rendering readOnly resources?