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.
Support Forum
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:
Store's filters config: https://www.bryntum.com/docs/calendar/api/Core/data/mixin/StoreFilter#config-filters
So that is an array of filter definition objects, as described here: https://www.bryntum.com/docs/calendar/api/Core/util/CollectionFilter
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.
Hi,
It's not working because there is a little bug we just caught. We created a ticket on that. Here it is https://github.com/bryntum/support/issues/5370
It's in ready-for-review status, It will be available in the next patch release
And here is an another way to achieve that:
const calendar = new Calendar({
...
listeners : {
beforeEventEditShow({ eventEdit }) {
const store = eventEdit.resourceField.store;
store.filter(item => !item.readOnly);
},
once : true
}
});
Docs :
https://bryntum.com/docs/calendar/api/Calendar/feature/EventEdit#event-beforeEventEditShow
Good Luck ,
Tasnim
- Attachments
-
- fRxSPXMlSo.png (102.38 KiB) Viewed 541 times