Custom Views and Filters


#1

Hi,

we would like to allow users of the gantt to filter their gantt view by custom fields and save these views to reuse them. How can we achieve this?

Thanks,
John


#2

Hello John,
You can filter tasks by using the onBeforeTaskDisplay event handler:
https://docs.dhtmlx.com/gantt/desktop__filtering.html
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskdisplay_event.html

Here are examples of how it works:
http://snippet.dhtmlx.com/5/c272f735b
http://snippet.dhtmlx.com/5/ec99aee01
http://snippet.dhtmlx.com/94180266e
http://snippet.dhtmlx.com/5/5d9aa48e6

However, Gantt is a client-side tool. It doesn’t save any data in the database or somewhere else. You need to manually save the Gantt configuration and the variable values that will define how the tasks are filtered.