Gantt custom sort

I need to sort projects by an internal task. The task has a sub-type. How can I sort the parent projects by the start date of the internal task?

Hello @NathanO,

The Gantt and most of our complex widgets (except Kanban and Spreadsheet) are built as modularized apps on Webix Jet, and the user can customize existing modules or add new ones.

Modules are implemented as JetViews (ES6 classes) where any UI element, data-related service, or feature can be customized by the same rules. For more details about this architecture, please check the following blog article, which describes the general idea and reasons for this structure.

Please note that complex modifications may require observing the source code of the tool in order to build the most feasible solution that will correctly alter/extend the original logic.

To change date sorting inside the tree view it’s necessary to rewrite the function that is responsible for the date sorting. Namely, sort(). This can be done by customizing view: create a class (CustomSorting, as an example) which extends gantt.views.tree. Inside this class, in the config(), you need to refer to the property sort of the start_date column and write the needed sorting function inside of:

  class CustomSorting extends gantt.views.tree {
    config() {
//custom logic goes here
  }

At the end, replace default views via the override map: override: new Map([[gantt.views.tree, CustomSorting]]).

Please take a look at the snippet for what sort customization looks like: Code Snippet