khan4019 / tree-grid-directive

Need one or more maintainer for this! comment or email me if you are interested
http://khan4019.github.io/tree-grid-directive/test/treeGrid.html
347 stars 183 forks source link

Sorting data #26

Closed kotmatpockuh closed 9 years ago

kotmatpockuh commented 9 years ago

Hi.

Seems that there is some stange behaviour with sorting:

<tr ng-repeat=\"row in tree_rows | orderBy:Pos...

but how to be, if node has leafs with such key Pos too? how to sort branches and leafs of branch via exaclty same field so that nodes are sorted via field, and branches are sorted only in scope of it's parent?

khan4019 commented 9 years ago

Why dont you sort data...before binding it to tree_data or tree_rows

kotmatpockuh commented 9 years ago

what would be in case if data will be updated on-the-fly when data is displayed?

khan4019 commented 9 years ago

The directive wasnt develop to handle update on the fly. you can use watcher. If you figure that out, will appreciate if you contribute

diosney commented 9 years ago

I need this functionality too. I don't promise anything, but in the next weeks I will try to add this feature.

To clarify, what you are asking for is:

And the tree data will be sorted by that column, with the specified sort order (asc or desc) for all tree levels, as:

Example of an asc sort order if the column was clicked:

a
     1
          i
          ii
     2
     3
b
khan4019 commented 9 years ago

+1

TrueDub commented 9 years ago

Sorting of columns now added in the latest pull request