[ANGULAR] color of events are changing while changing events dynamically.
Is there a way to refresh calendar view?
The color of the events are changing while I am tryin to change events dynamically.
Is there a way to refresh calendar view?
The color of the events are changing while I am tryin to change events dynamically.
You should never have to refresh the calendar manually. Can you please share some more context on what you are trying to achieve?
Hi mats,
I have been trying to change the events dynamically based on the text filter.
step1:
Now I have typed a text which is not matching with any event
step:2
Next I have typed text in step1, event loaded but with different color(grey).
I am thinking if there is any way I can refresh view to regain the event color
Sounds a bit like you're looking for a highlight feature, as showcased here? https://bryntum.com/products/scheduler/examples/filtering/
You can inspect how that's done in the Scheduler sample sources:
tbar : [
{
type : 'textfield',
ref : 'highlight',
placeholder : 'Highlight tasks',
clearable : true,
keyStrokeChangeDelay : 100,
triggers : {
filter : {
align : 'start',
cls : 'b-fa b-fa-search'
}
},
onChange({ value }) {
scheduler.eventStore.forEach(task => {
const taskClassList = new DomClassList(task.cls);
if (value !== '' && task.name.toLowerCase().includes(value.toLowerCase())) {
taskClassList.add('b-match');
}
else {
taskClassList.remove('b-match');
}
task.cls = taskClassList.value;
});
scheduler.element.classList[value.length > 0 ? 'add' : 'remove']('b-highlighting');
}
}
]
Hey Mats,
The event is already highlighted based on event type.
meetingType: Array<CalendarResouce> = [
{
id: ResourceIds.ALL_CALENDAR_ENTRIES_RESOURCE_ID,
name: 'All Calendar entries',
eventColor: '#7498BF',
},
{
id: 6,
name: 'Analyst/Consultant Meeting',
eventColor: '#8A8E2B',
},
{
id: 1,
name: 'Company Visit',
eventColor: '#958BBF',
},
{
id: 2,
name: 'Conference',
eventColor: '#C67A9E',
},
{
id: 3,
name: 'Group',
eventColor: '#7C9D7C',
},
{
id: 4,
name: 'One on One',
eventColor: '#DBAA5A',
},
{
id: 5,
name: 'Other',
eventColor: '#AA5051',
},
{
id: ResourceIds.UNDEFINED_RESOURCE_ID,
name: 'Undefined',
eventColor: '#AAAAAA',
},
{
id: ResourceIds.MY_MEETINGS_ID,
name: 'My Meetings',
eventColor: '#6871C1',
},
];
but when try to use filters on events, the event color is changing, turned to green.
If I reload again event getting right color, SO I thought if there is a way to refresh Calendar UI to regain right color.
Could you please share your code? It's not clear how did highlight events, as well how did you filter events.
I tested here https://bryntum.com/products/calendar/examples/basic/
It has colours defined for events and filter textfield that I tried to type and see if events change color after filtering.