Take the 2-minute tour ×


I am using ng-grid to display a list of items. I want to give my users ability to rearrange the rows in the list. i.e move the rows up and down as they please.

Now, However when I update the grid data in the backend i.e say change the index of a particular row, that row does not automatically change locations in the front-end.

What am i missing here ?

I have created a plunker to describe the problem http://plnkr.co/edit/s1hrTSqF2zeZo3Btaln0

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

The grid doesn't use the index of the array to order it, so even if you are changing it, because the data is still there nothing happens.

What you could do is define an order field and update the value then changing the values as shown in this plukr. The order field you can hide it from the grid if required using columnDefs to explicitly defined which column should be shown.


share|improve this answer
thanks.. that works –  James Hans Aug 21 '13 at 17:54
add comment

Your Answer


