Our state of the art Gantt chart


Post by pawel »

I have the kind of tasks that are treated differently from the rest. They represent the project details and no matter what filters are applied, they should be displayed. How do I do that universally, so it works across all filters, and all methods of adding those filters. Meaning, by user interaction, or programatically added with taskStore.filter(), and after page reload when those filters were recovered from local storage (stateProvider).


Post by tasnim »

Hi,

By using https://bryntum.com/products/gantt/docs/api/Gantt/data/TaskStore#function-filter you'd have full control of the filter.
So you could put a condition inside of taskStore.filter to ignore filter for some specific tasks

And if you want to use a filterFn for a specific column, then please check this https://bryntum.com/products/scheduler/docs/api/Grid/column/Column#config-filterable

I hope this will help.

Let us know if you have any other questions


Post by pawel »

Hi tasnim!

Could you write a small snippet that would show me how can I solve my problem with taskStore.filter? Because I really don't understand it and I spent already quite a few hours on this.


Post by marcio »

Hey pawel,

You can use it like this

// Filter using function - always showing the record with id = 12
taskStore.filter(r => r.id == 12 || // filter condition);

Best regards,
Márcio


Post by pawel »

Hey Marcio!

How this filter is supposed to work after being pulled from saved state in stateProvider?

marcio and tasnim, I think you focus only on the title of this post and ignore the description.


Post by tasnim »

Hi,

Sorry, I didn't understand the question about stateProvider.
Now it's clean, You could use https://bryntum.com/products/gantt/docs/api/Core/mixin/State#function-getState to get the states
And apply the filter using the taskStore.filter()

gantt.getState();

I hope this will help


Post by Animal »

Functions cannot be saved in state. I don't think this will be possible.


Post Reply