Add row reorder feature
The row move feature seems broken?
$scope.gridOptions{enableRowReordering: true};
Looking at the source code, no "enableRowReordering" is found. https://github.com/angular-ui/ng-grid/blob/2.0.8/build/ng-grid.js
I don't believe this feature actually exists in the 2.x code base, as @junkoro has noted. I also haven't seen it in the 3.0 code base. I would imagine that the best way to reorder would be to provide some method to reorder the data in your base dataset, and then re-render the grid.
the answer doesn't seem right to me, I think the issue is rather about a drag and drop feature (not sort)...
I did see this plugin in the code base, although I have no experience with it: https://github.com/angular-ui/ng-grid/blob/2.x/plugins/ng-grid-reorderable.js
yep, that seems to be the desired feature but I think that it doesn't work anymore
There was a commit one month ago that claims to have fixed outstanding issues. I'm not in a position to test that, but it possibly does work now.
would you consider moving it to 3.x then?
I think it can be considered. It's beyond my skills to do so, I was going to look at CSV export, which doesn't involve any UI skills. Would you be in a position to contribute?
I don't have much experience with drag and drop and don't have much time right now, but I might look into it in the future.
@PaulL1, it seems like you meant to reopen the issue but didn't do so...
I just released a plug-in for ng-grid 2.0.8 that enables row reordering by drag and drop. https://github.com/junkoro/ng-grid-draggable-row
In this plug-in, I needed to apply data changes manually. Because it seems that the dataWatcher doesn't refresh until the data array length is changed.
@junkoro Your plugin works great. However I have scroll-bar in my grid. It does not auto-scroll when I am trying to reorder rows. Any suggestion on how to auto-scroll during reordering rows will be helpful.
@gauravhub Oh, I didn't notice that. Because auto-scroll is done by Chrome.
The "dragover" event handler (see line 117) is the key to support auto-scroll function. In this event handler, we will need some codes like isNeedAutoScroll(), scrollUp() and scrollDown().
Obviously, it should be supported in the plugin. But I have no time right now. I'm sorry.
I'm moving this to 2.x, in favour of #1359 for 3.0.
@junkoro , THANK you so much for you plugin, it worked like a charm. I onle had to add z-index:2 to the dragover class.
What is the status on this? @junkoro does your plugin work with 3.0? Oh and how the heck would row dragging work with pagination ... my head hurts
duplicate of #1359