Clearing resourceStore filters triggers the re-rendering of the entire scheduler

Our pure JavaScript Scheduler component
Post Reply
User avatar
armandcolenati
Posts: 3
Joined: Fri Nov 08, 2019 3:58 pm

Clearing resourceStore filters triggers the re-rendering of the entire scheduler

Post by armandcolenati » Fri Nov 08, 2019 5:09 pm

Hello!

We got a scheduler with 12 resources and more than 800 events and we came across this problem while trying to add filtering. Looks like while filtering the resourceStore, the events which correspond to resources which are filtered out are removed entirely from the DOM. That means that whenever we clear the array of filters, all resources and events are going to be rendered again. This leads to performance issues.

For filtering:

Code: Select all

scheduler.resourceStore.filter((resource) => {
	return filters.some((filter) => resource.name.indexOf(filter) >= 0);
});
For removing the filters:

Code: Select all

scheduler.resourceStore.clearFilters();
You can also check this using the filtering live example: https://www.bryntum.com/examples/scheduler/filtering/
Filter the staff in order to get only one employee, then inspect the DOM and you're going to find only the event of that employee.
When you clear the filter, you'll observe that the rest of the events of the employees which previously have been filtered out are going to be added to the DOM.

I am not sure if this works as intended or if it is a bug, but we would like to have to possibility to just hide the resources which do not match the filter criteria and the events associated to them.

User avatar
mats
Core Developer
Core Developer
Posts: 14801
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: Clearing resourceStore filters triggers the re-rendering of the entire scheduler

Post by mats » Fri Nov 08, 2019 5:15 pm

How can we see your performance issue? Could you upload your dataset so we can inspect?
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
armandcolenati
Posts: 3
Joined: Fri Nov 08, 2019 3:58 pm

Re: Clearing resourceStore filters triggers the re-rendering of the entire scheduler

Post by armandcolenati » Fri Nov 08, 2019 5:26 pm

Unfortunately, I don't think I'm allowed to share the dataset. The performance issue most likely comes from the fact that the events are not being hidden, but actually removed from the DOM, then readded after the filters have been removed. You can actually see the DOM changes in the filtering demo mentioned earlier.

User avatar
mats
Core Developer
Core Developer
Posts: 14801
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: Clearing resourceStore filters triggers the re-rendering of the entire scheduler

Post by mats » Mon Nov 11, 2019 1:10 pm

Ok, you could just replace any texts in your data with XXXX and then upload it perhaps?
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

Post Reply