When I load my data I use rounded eventstyle. Wht I wish to do is to change eventstyle after modification
What is the right way o obtain this result? I tried to change style in evenstore events, I do this because I have to change a filed in my table (modified true/false)
Maybe, I have to use beforeEventDropFinalize?
In beforeEventDropFinalize I tried to use repaintEventsForResource ma doesn'twork
The strange thing is that when I call repaintEventsForResource eventStyle is 'plain' (as i want)
I suppose that I have to use eventrender but this event is raised only when I load my data for the first time not when I change a data
You can extend the EventModel and implement getter and setter for the eventStyle field. Please try it in the Basic demo (non-angular demo, but the same is true for angular):
Scheduler/examples/basic/app.js
import EventModel from '../../lib/Scheduler/model/EventModel.js';
class StyledEventModel extends EventModel {
static get $name() {
return 'StyledEventModel';
}
get eventStyle() {
return super.eventStyle || (this.isModified ? 'line' : 'rounded');
}
set eventStyle(style) {
super.eventStyle = style;
}
}
.....
const scheduler = new Scheduler({
appendTo : 'container',
minHeight : '20em',
resources : resources,
//events : events,
eventStore : {
modelClass : StyledEventModel,
data : events
},
I tried your code but I have this error (view attachment)
(property) StyledEventModel.eventStyle: string
'eventStyle' is defined as a property in class 'EventModel', but is overridden here in 'StyledEventModel' as an accessor.ts(2611)
What angular/typescript version are you using? I don't see this error in our Angular Basic demo. But the error message looks correct. Since you know that you override a field which is declared as a property on the EventModel, you can try to suppress the error.
Thank for your reply, I used // @ts-nocheck and this solved
Now works, but there si another small problem..
I can see eventstyle change only if I move the bottom scroolbar.
initial situation (01.png)
I move an event and I want change eventstyle and use stack position but doesn't change (02.png)
I move the scroolbar in the bottom and everything is as I want (03.png)
The sideeffect is that this resolve another problem I wrote in another post (When I drag event abobe another I wish stack but this doesn't work if I handle beforeEventDropFinalize)
This work in the same way. I prefere this solution but also in this case, I see the right result only after click on scroolbar
How can I force or call a render action?