Hello, in my example, I have two buttons.
Click me -> to load the initial data
Filter me -> to filter the initial data by only removing some of the initial events.
Click works fine for me as expected. However, the Filter me button does not work as expected and the brintum component is not updated with the events that are filtered.
Could you help me understand why the filter button doesn't work as expected?
By the way, I've noticed that the drag and drop fails and the event that shouldn't paint is blocked, not letting me move or resize it.
Support Forum
Hello, thank you very much for your quick response. I understand what you're saying, but I need to do it like in the example I'm proposing, because in a much larger and much more complex project, it's being done that way and making the change you're proposing would be a lot of work. Could you work on my example to try to make it work?
Thank you very much in advance
There are might be many reasons.
- For Angular we do not recommend use Scheduler without wrapper. See our demos and guide https://bryntum.com/products/scheduler/docs/guide/Scheduler/integration/angular/guide
- You used
resourceId
together withassignmentStore
, but you should use orresourceId
orassignmentStore
data.
https://bryntum.com/products/scheduler/docs/api/Scheduler/model/EventModel#field-resourceId - You are destroying and re-creating component on data change, so that might be a race-condition problem.
- You created EventModel instance before load it onto store, so
resourceId
might be cleared because assignment won't be resolved - when no according resource found, assignment cannot be created and resourceId linking will be removed.
All the best,
Alex
Hi Alex, thanks for your response.
In response to your reply, I would like to tell you the following:
1.- Thanks for the indication. I'm going to try to build another example using the wrapper.
2.- Could you tell me in which line of my attached example I am using the resourceId mode? My approach is using AssignmentStore if I'm not mistaken. Please I need confirmation of this.
3.- The fact of destroying it should be totally freeing the memory of the object and not leaving orphaned data inside the freed variable. However, I'll set it to null beforehand and I understand that this shouldn't be a problem.
4.- This comment does not make sense; it seems to be a standard answer that does not apply to my case. I don't see that I am assigning any resourceId in my code. Please review it again and see if this comment is consistent with my exposed case.
#2 Here
this.events = [...this.events.filter(x=> x.id>1)];
//recargo los assignments como en proyecto final
this.assignments = [];
this.events.forEach(event =>
this.assignments.push({
id : 'a' + event.id,
event : event.id,
resource : event.resourceId
})
if you used this.events
as data for the scheduler, this means resourceId
is filled.
And yes you did.
this.scheduler.project = new ProjectModel({
// ...
eventStore : {
useRawData : true,
data : this.events
}
});
No 4
I highlighted possible reasons for your analyse. If you see it's not fit to you, just leave it. It's hard to understand what exactly happening in your code, I see in your code both - resourceId and assignmentStore, as well as I see you created EventModel instance out of store. That's why I mentioned that moment for you to check.
All the best,
Alex