Grouping 3 level deep for a treeview interface

I can’t figure out a way to group a simple list into a 3-level deep structure for treeview. Say we had a dataset of movies, and I’d like to group by genre (“comedy”,“drama”,etc), then by year, and then show the titles of the movies.

Comedy:
→ 2015
→ Title 1
→ Title 2
→ 2016
→ Title 3
Drama:
→ 2015
→ 2016

I read examples in the documentation (http://docs.webix.com/desktop__grouping.html) but they all show a 2-level deep structure, grouping by a single parameter only…

Our grouping method assumes the two-level result.

As a workaround, it’s possible to applygroup() method twice to the datastore of TreeTable (“data” property of datatable instance. I didn’t mention this peculiarity in the foregoing PM).

In the first iteration, you need to group the data by two criteria (year & genre),
in the next one - only by top-level criteria (genre).

Please check the following sample: http://webix.com/snippet/cc60e42f

This is exactly what I was looking for! Thank you.