ng-material-treetable icon indicating copy to clipboard operation
ng-material-treetable copied to clipboard

Support for sorting by column

Open stackenblochen opened this issue 6 years ago • 2 comments

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

stackenblochen avatar Sep 20 '19 09:09 stackenblochen

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 |
+----------+-------+

mlrv avatar Sep 21 '19 09:09 mlrv

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.

stackenblochen avatar Sep 21 '19 10:09 stackenblochen