jadrake75 / ng-scrolling-table

MIT License
8 stars 2 forks source link

Reordering #41

Closed Xanir closed 9 years ago

Xanir commented 10 years ago

The reordering can be tested by adding the following to the post link function:

                    $timeout(function() {
                        scope.bodyElemArray.push(scope.bodyElemArray.shift());
                        scope.headersElemArray.push(scope.headersElemArray.shift());
                        scope.rebuildTable();
                    }, 5000, true);

When I look at doing header drag and drop to reorder I'll also add some additional methods to easily manage reordering columns to keep the headers and data columns in sync.

Let me know your thoughts about this, it is a bit unfortunate that the table needs to be rebuilt but I cannot think of a way around it as the ng-repeat will retain the original template. However the scrolling position is retained. There does seem to be a bit of a delay in the rendering of the table, perhaps it can be minimized later, at least column reordering should not be a common action and the order could be stored in the local cache or something.