mlrv / ng-material-treetable

Angular Material treetable component :deciduous_tree: :heart: ♻️
http://ng-material-treetable.surge.sh
MIT License
99 stars 65 forks source link

Support for sorting by column #33

Open stackenblochen opened 5 years ago

stackenblochen commented 5 years ago

Hi, is it planned to support sorting by column with this component?

mlrv commented 5 years ago

Hi @stackenblochen, I'm not entirely about this tbh. A tree has some sort of natural hierarchy / order already, as an example, how should we sort a tree like this?

+----------+-------+
|          | Value |
+----------+-------+
| A        |    10 |
| - A1     |    50 |
| - B1     |    30 |
| - C1     |    20 |
| B        |    40 |
| C        |    50 |
|  - C1    |   100 |
|   - C2   |    45 |
|   - C3   |    55 |
+----------+-------+
stackenblochen commented 5 years ago

Thanks for your message. The tree can be ordered by alphabet (first column in your example) or by any other column (value in your example). The tree structure should be kept when sorting by another column, though.