Add new row in UI-Grid.
I am using $scope.gridOptions.data.push({}); to add new row in my grid layout which is appending a new row at the end of data set. But I need to add a row at the top of my current pagination scope.I there any way doing this?
The rows by default are in the same order as your data. So $scope.gridOptions.data.unshift({}); should do it. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift
Thanks Paul for quick reply. But my issue is to add a row in which page I am. If I am in the 2nd page then add new Row will add a row in 2nd page.
In that case you'd need to use splice, and need to work out which page you were on and splice at the correct point.
No further comment for over a month, solution provided that probably resolves the issue. Closing, please re-raise if there is a reliable recreate or more information.