File tree 2 files changed +12
-5
lines changed
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 108
108
self . grid . modifyRows ( newData )
109
109
. then ( function ( ) {
110
110
// if (self.viewport) {
111
- self . grid . redrawInPlace ( ) ;
111
+ self . grid . redrawInPlace ( true ) ;
112
112
// }
113
113
114
114
$scope . $evalAsync ( function ( ) {
Original file line number Diff line number Diff line change @@ -2001,9 +2001,10 @@ angular.module('ui.grid')
2001
2001
* @name redrawCanvas
2002
2002
* @methodOf ui.grid.class:Grid
2003
2003
* @description Redraw the rows and columns based on our current scroll position
2004
+ * @param {boolean } [rowsAdded] Optional to indicate rows are added and the scroll percentage must be recalculated
2004
2005
*
2005
2006
*/
2006
- Grid . prototype . redrawInPlace = function redrawInPlace ( ) {
2007
+ Grid . prototype . redrawInPlace = function redrawInPlace ( rowsAdded ) {
2007
2008
// gridUtil.logDebug('redrawInPlace');
2008
2009
2009
2010
var self = this ;
@@ -2012,9 +2013,15 @@ angular.module('ui.grid')
2012
2013
var container = self . renderContainers [ i ] ;
2013
2014
2014
2015
// gridUtil.logDebug('redrawing container', i);
2015
-
2016
- container . adjustRows ( null , container . prevScrolltopPercentage , true ) ;
2017
- container . adjustColumns ( null , container . prevScrollleftPercentage ) ;
2016
+
2017
+ if ( rowsAdded ) {
2018
+ container . adjustRows ( container . prevScrollTop , null ) ;
2019
+ container . adjustColumns ( container . prevScrollTop , null ) ;
2020
+ }
2021
+ else {
2022
+ container . adjustRows ( null , container . prevScrolltopPercentage ) ;
2023
+ container . adjustColumns ( null , container . prevScrollleftPercentage ) ;
2024
+ }
2018
2025
}
2019
2026
} ;
2020
2027
You can’t perform that action at this time.
0 commit comments