Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
base repository: angular-ui/ui-grid
Choose a Base Repository
angular-ui/ui-grid
Aardvark71/ng-grid
AdelinGhanaem/ng-grid
AlasdairSwan/ng-grid
AntonFend/ng-grid
CNXTEoEorg/ui-grid
Dashue/ng-grid
Donderda/ng-grid
EricEngineered/ng-grid
EugeneBorshch/ng-grid
EugeneTruly/ng-grid
GenesysPureConnect/ng-grid
Jammasternam/ng-grid
JavaBasketball/ui-grid
Jenk-Rendar/ng-grid
JonahKE/ui-grid
KNaved/ui-grid
Klarence/ng-grid
Martin17/ng-grid
Mistobaan/ng-grid
Moreface/ng-grid
Pasha-Pramati/ng-grid
Premier/ng-grid
Reskov/ng-grid
SummerDejavu/ng-grid
UrvilKaswala/ng-grid
Wiinis/ng-grid
YonatanKra/ui-grid
a5sk4s/ng-grid
aaks2010/ng-grid
akhileshappala/ui-grid
alecswan/ng-grid
alexspurling/ng-grid
alpinegizmo/ng-grid
anuradha18/ng-grid
archsh/ng-grid
ata-n/ng-grid
avgalon/ng-grid
avikaco/ng-grid
ballmw/ng-grid
bbradbury/ng-grid
benjaminkitt/ng-grid
benmj/ng-grid
blackneus/ng-grid
bmleite/ng-grid
boland/ng-grid
bpoussin/ng-grid
bradlund/ng-grid
bundance/ng-grid
caphun/ng-grid
ccreed2/ui-grid
cdesogeti/ng-grid
ceolter/ui-grid
chanu587/ng-grid
chinnurtb/ng-grid
chiragchamoli/ng-grid
choroshin/ng-grid
christoffee/ng-grid
clkao/ng-grid
cxl55/ng-grid
daclubb/ng-grid
darkhorse-dev/ui-grid
darknos/ng-grid
dcolens/ng-grid
dean-me/ng-grid
demon-lord/ng-grid
devony/ng-grid
doctorsender/ng-grid
ebraminio/ng-grid
ezecafre89/ng-grid
felixhummel/ng-grid
firmusoft/ng-grid
francescoagati/ng-grid
frogomatic/ng-grid
garaboncias/ng-grid
getuliojr/ng-grid
giosakti/ng-grid
goldhand/ng-grid
goodluck2016/ui-grid
hawtio/ng-grid
hey24sheep/ui-grid
hoshidaniel/ng-grid
hotings/ng-grid
hucarrot/ng-grid
imloama/ng-grid
ineedfat/ng-grid
is-fredrik/ng-grid
ismakv/ui-grid
itxd/ui-grid
jeado/ng-grid
jeanpuga/ui-grid
jeffbcross/ng-grid
jeffslofish/ng-grid
jessegavin/ng-grid
jfzman/ng-grid
jharohit/ng-grid
jiacomino/ng-grid
jimhotchkin-wf/ng-grid
jimmytheneutrino/ng-grid
jmaynier/ng-grid
johlrich/ng-grid
johnobe/ng-grid
johnparn/ng-grid
jon23cooper/ng-grid
jozzhart/ng-grid
jspeshu/ng-grid
jstrachan/ng-grid
juliofreitas/ui-grid
jurby/ng-grid
karnyj/ng-grid
keathley/ng-grid
keithharvey/ng-grid
kmussel/ng-grid
koen-serry/ng-grid
konrad-garus/ng-grid
krahman/ng-grid
ksmoore/ng-grid
kugel-soft/ui-grid
lebedevsergey/ui-grid-fix-issue-with-pinned-columns-in-v2
leninloganathan/ui-grid
liergouzi/ui-grid
loiphamvn/ng-grid
longFeiLi/ui-grid
marciosartini/ng-grid
marklagendijk/ng-grid
martijnve/ng-grid
mathiasdose/ng-grid
mathieurivest/ng-grid
matpaprocki/ng-grid
mattlaver/ng-grid
maxcan/ng-grid
mchapman/ng-grid
mediaprojects/ng-grid
mgibson/ng-grid
mheye/ng-grid
mmatczak/ui-grid
mschroering/ng-grid
musically-ut/ng-grid
mxreppy/ng-grid
niilante/ui-grid
nishant8BITS/ng-grid
noming/ng-grid
nuclearghost/ng-grid
orneryd/ng-grid
owenXin/ng-grid
pdegenhardt/ng-grid
pdemanget/ng-grid
ppollono/ng-grid
prabhat2233/ui-grid
presidento/ng-grid
r7lemieux/ng-grid
richiepreece/ng-grid
ronbuchanan/ng-grid
sagarwasule/ng-grid
sapronlee/ng-grid
satyanand/ng-grid
sax1johno/ui-grid
seankenny/ng-grid
simonengelhardt/ng-grid
simplyjames/ng-grid
skusunam/ng-grid
snapappointments/ui-grid
sofibraun/ng-grid
solvebio/ng-grid
songguang-2010/ng-grid
sonicparke/ng-grid
sourcec0de/ng-grid
sravanthipoujula/ng-grid
sskyy/ng-grid
stan-z/ng-grid
strider820/ng-grid
sunfirefox/ng-grid
surfer26th/ng-grid
suryasingh/ng-grid
swalters/ng-grid
tcrimi/ng-grid
tetralon/ng-grid
thedarkjester/ng-grid
tjosbon/ng-grid
tkhemani/ng-grid
tradingscreen/ng-grid
tuckerjt07/ui-grid
turn/ng-grid
uapui-dev/ng-grid
vargose/ng-grid
vladovidiu/ng-grid
wdmny/ng-grid
wp-ng/ui-grid
xordad/ng-grid
xtidt/ui-grid
xtreme-christophe/ng-grid
yangsong158/ui-grid
yanl/ng-grid
yarl/ng-grid
yesnault/ng-grid
yunmanger1/ng-grid
zelingo/ui-grid
zhangdiwaa/ng-grid
zhanghaihua/ng-grid
ztp130213/ng-grid
Nothing to show
base: 078d6b0f708d
head repository: angular-ui/ui-grid
Choose a Head Repository
angular-ui/ui-grid
Aardvark71/ng-grid
AdelinGhanaem/ng-grid
AlasdairSwan/ng-grid
AntonFend/ng-grid
CNXTEoEorg/ui-grid
Dashue/ng-grid
Donderda/ng-grid
EricEngineered/ng-grid
EugeneBorshch/ng-grid
EugeneTruly/ng-grid
GenesysPureConnect/ng-grid
Jammasternam/ng-grid
JavaBasketball/ui-grid
Jenk-Rendar/ng-grid
JonahKE/ui-grid
KNaved/ui-grid
Klarence/ng-grid
Martin17/ng-grid
Mistobaan/ng-grid
Moreface/ng-grid
Pasha-Pramati/ng-grid
Premier/ng-grid
Reskov/ng-grid
SummerDejavu/ng-grid
UrvilKaswala/ng-grid
Wiinis/ng-grid
YonatanKra/ui-grid
a5sk4s/ng-grid
aaks2010/ng-grid
akhileshappala/ui-grid
alecswan/ng-grid
alexspurling/ng-grid
alpinegizmo/ng-grid
anuradha18/ng-grid
archsh/ng-grid
ata-n/ng-grid
avgalon/ng-grid
avikaco/ng-grid
ballmw/ng-grid
bbradbury/ng-grid
benjaminkitt/ng-grid
benmj/ng-grid
blackneus/ng-grid
bmleite/ng-grid
boland/ng-grid
bpoussin/ng-grid
bradlund/ng-grid
bundance/ng-grid
caphun/ng-grid
ccreed2/ui-grid
cdesogeti/ng-grid
ceolter/ui-grid
chanu587/ng-grid
chinnurtb/ng-grid
chiragchamoli/ng-grid
choroshin/ng-grid
christoffee/ng-grid
clkao/ng-grid
cxl55/ng-grid
daclubb/ng-grid
darkhorse-dev/ui-grid
darknos/ng-grid
dcolens/ng-grid
dean-me/ng-grid
demon-lord/ng-grid
devony/ng-grid
doctorsender/ng-grid
ebraminio/ng-grid
ezecafre89/ng-grid
felixhummel/ng-grid
firmusoft/ng-grid
francescoagati/ng-grid
frogomatic/ng-grid
garaboncias/ng-grid
getuliojr/ng-grid
giosakti/ng-grid
goldhand/ng-grid
goodluck2016/ui-grid
hawtio/ng-grid
hey24sheep/ui-grid
hoshidaniel/ng-grid
hotings/ng-grid
hucarrot/ng-grid
imloama/ng-grid
ineedfat/ng-grid
is-fredrik/ng-grid
ismakv/ui-grid
itxd/ui-grid
jeado/ng-grid
jeanpuga/ui-grid
jeffbcross/ng-grid
jeffslofish/ng-grid
jessegavin/ng-grid
jfzman/ng-grid
jharohit/ng-grid
jiacomino/ng-grid
jimhotchkin-wf/ng-grid
jimmytheneutrino/ng-grid
jmaynier/ng-grid
johlrich/ng-grid
johnobe/ng-grid
johnparn/ng-grid
jon23cooper/ng-grid
jozzhart/ng-grid
jspeshu/ng-grid
jstrachan/ng-grid
juliofreitas/ui-grid
jurby/ng-grid
karnyj/ng-grid
keathley/ng-grid
keithharvey/ng-grid
kmussel/ng-grid
koen-serry/ng-grid
konrad-garus/ng-grid
krahman/ng-grid
ksmoore/ng-grid
kugel-soft/ui-grid
lebedevsergey/ui-grid-fix-issue-with-pinned-columns-in-v2
leninloganathan/ui-grid
liergouzi/ui-grid
loiphamvn/ng-grid
longFeiLi/ui-grid
marciosartini/ng-grid
marklagendijk/ng-grid
martijnve/ng-grid
mathiasdose/ng-grid
mathieurivest/ng-grid
matpaprocki/ng-grid
mattlaver/ng-grid
maxcan/ng-grid
mchapman/ng-grid
mediaprojects/ng-grid
mgibson/ng-grid
mheye/ng-grid
mmatczak/ui-grid
mschroering/ng-grid
musically-ut/ng-grid
mxreppy/ng-grid
niilante/ui-grid
nishant8BITS/ng-grid
noming/ng-grid
nuclearghost/ng-grid
orneryd/ng-grid
owenXin/ng-grid
pdegenhardt/ng-grid
pdemanget/ng-grid
ppollono/ng-grid
prabhat2233/ui-grid
presidento/ng-grid
r7lemieux/ng-grid
richiepreece/ng-grid
ronbuchanan/ng-grid
sagarwasule/ng-grid
sapronlee/ng-grid
satyanand/ng-grid
sax1johno/ui-grid
seankenny/ng-grid
simonengelhardt/ng-grid
simplyjames/ng-grid
skusunam/ng-grid
snapappointments/ui-grid
sofibraun/ng-grid
solvebio/ng-grid
songguang-2010/ng-grid
sonicparke/ng-grid
sourcec0de/ng-grid
sravanthipoujula/ng-grid
sskyy/ng-grid
stan-z/ng-grid
strider820/ng-grid
sunfirefox/ng-grid
surfer26th/ng-grid
suryasingh/ng-grid
swalters/ng-grid
tcrimi/ng-grid
tetralon/ng-grid
thedarkjester/ng-grid
tjosbon/ng-grid
tkhemani/ng-grid
tradingscreen/ng-grid
tuckerjt07/ui-grid
turn/ng-grid
uapui-dev/ng-grid
vargose/ng-grid
vladovidiu/ng-grid
wdmny/ng-grid
wp-ng/ui-grid
xordad/ng-grid
xtidt/ui-grid
xtreme-christophe/ng-grid
yangsong158/ui-grid
yanl/ng-grid
yarl/ng-grid
yesnault/ng-grid
yunmanger1/ng-grid
zelingo/ui-grid
zhangdiwaa/ng-grid
zhanghaihua/ng-grid
ztp130213/ng-grid
Nothing to show
compare: d6b8ff960f53
  • 2 commits
  • 7 files changed
  • 0 commit comments
  • 2 contributors
Commits on Dec 24, 2014
Changed renderContainer and native scroll bar, as well as cellNav,
to put a grid into the args on GRID_SCROLL broadcast, and to then
check and ignore any scroll that has a grid in args and that grid
isn't the current grid.
Fix #2380 (cellNav): ScrollTo was scrolling all grids on page
@@ -54,11 +54,11 @@ Provides an example of scrolling to and setting the focus on a specific cell, us
};

$scope.scrollTo = function( rowIndex, colIndex ) {
$scope.gridApi.cellNav.scrollTo( $scope.gridApi.grid, $scope, $scope.gridOptions.data[rowIndex], $scope.gridOptions.columnDefs[colIndex]);
$scope.gridApi.cellNav.scrollTo( $scope, $scope.gridOptions.data[rowIndex], $scope.gridOptions.columnDefs[colIndex]);
};

$scope.scrollToFocus = function( rowIndex, colIndex ) {
$scope.gridApi.cellNav.scrollToFocus( $scope.gridApi.grid, $scope, $scope.gridOptions.data[rowIndex], $scope.gridOptions.columnDefs[colIndex]);
$scope.gridApi.cellNav.scrollToFocus( $scope, $scope.gridOptions.data[rowIndex], $scope.gridOptions.columnDefs[colIndex]);
};

$scope.gridOptions.onRegisterApi = function(gridApi){
@@ -8,10 +8,18 @@ each other.
@example
<example module="app">
<file name="app.js">
var app = angular.module('app', ['ngTouch', 'ui.grid', 'ui.grid.selection']);
var app = angular.module('app', ['ngTouch', 'ui.grid', 'ui.grid.selection', 'ui.grid.cellNav']);

app.controller('MainCtrl', ['$scope', '$http', '$log', function ($scope, $http, $log) {
$scope.gridOptions = {};
$scope.gridOptions = {
onRegisterApi: function(gridApi){
$scope.gridApi = gridApi;
}
};

$scope.scrollTo = function( rowIndex, colIndex ) {
$scope.gridApi.cellNav.scrollTo( $scope, $scope.gridOptions.data[rowIndex], $scope.gridOptions.columnDefs[colIndex]);
};

$http.get('/data/100.json')
.success(function(data) {
@@ -32,10 +40,11 @@ each other.
</file>
<file name="index.html">
<div ng-controller="MainCtrl">
<div id="firstGrid" ui-grid="gridOptions" ui-grid-selection class="grid"></div>
<button type="button" class="btn btn-success" ng-click="scrollTo(20,0)">Scroll To Row 20</button>
<div id="firstGrid" ui-grid="gridOptions" ui-grid-selection ui-grid-cellNav class="grid"></div>
</div>
<div ng-controller="SecondCtrl">
<div id="secondGrid" ui-grid="gridOptions" ui-grid-selection class="grid"></div>
<div id="secondGrid" ui-grid="gridOptions" ui-grid-selection ui-grid-cellNav class="grid"></div>
</div>
</file>
<file name="main.css">
@@ -472,6 +472,8 @@
*/
scrollToInternal: function (grid, $scope, gridRow, gridCol) {
var args = {};

args.grid = grid;

if (gridRow !== null) {
var seekRowIndex = grid.renderContainers.body.visibleRowCache.indexOf(gridRow);
@@ -503,6 +505,8 @@
*/
scrollToIfNecessary: function (grid, $scope, gridRow, gridCol) {
var args = {};

args.grid = grid;

// Alias the visible row and column caches
var visRowCache = grid.renderContainers.body.visibleRowCache;
@@ -823,6 +827,11 @@

// When there's a scroll event we need to make sure to re-focus the right row, because the cell contents may have changed
$scope.$on(uiGridConstants.events.GRID_SCROLL, function (evt, args) {
// Skip if not this grid that the event was broadcast for
if (args.grid && args.grid.id !== uiGridCtrl.grid.id) {
return;
}

// Skip if there's no currently-focused cell
if (uiGridCtrl.grid.api.cellNav.getFocusedCell() == null) {
return;
@@ -211,49 +211,49 @@ describe('ui.grid.edit uiGridCellNavService', function () {
it('should request scroll to row and column', function () {
uiGridCellNavService.scrollTo( grid, $scope, grid.options.data[4], grid.columns[4].colDef);

expect(args).toEqual( { y : { percentage : (3 + 3/9 ) / 10 }, x : { percentage : (300 + 100 * 4/10)/1500 } });
expect(args).toEqual( { grid: grid, y : { percentage : (3 + 3/9 ) / 10 }, x : { percentage : (300 + 100 * 4/10)/1500 } });
});

it('should request scroll to row only - first row', function () {
uiGridCellNavService.scrollTo( grid, $scope, grid.options.data[0], null);

expect(args).toEqual( { y : { percentage : 0 } });
expect(args).toEqual( { grid: grid, y : { percentage : 0 } });
});

it('should request scroll to row only - last row', function () {
uiGridCellNavService.scrollTo( grid, $scope, grid.options.data[10], null);

expect(args).toEqual( { y : { percentage : 1 } });
expect(args).toEqual( { grid: grid, y : { percentage : 1 } });
});

it('should request scroll to row only - row 4', function () {
uiGridCellNavService.scrollTo( grid, $scope, grid.options.data[5], null);

expect(args).toEqual( { y : { percentage : ( 4 + 4/9 ) / 10 } });
expect(args).toEqual( { grid: grid, y : { percentage : ( 4 + 4/9 ) / 10 } });
});

it('should request scroll to column only - first column', function () {
uiGridCellNavService.scrollTo( grid, $scope, null, grid.columns[0].colDef);

expect(args).toEqual( { x : { percentage : 0 } });
expect(args).toEqual( { grid: grid, x : { percentage : 0 } });
});

it('should request scroll to column only - last column', function () {
uiGridCellNavService.scrollTo( grid, $scope, null, grid.columns[10].colDef);

expect(args).toEqual( { x : { percentage : 1 } });
expect(args).toEqual( { grid: grid, x : { percentage : 1 } });
});

it('should request scroll to column only - column 7', function () {
uiGridCellNavService.scrollTo( grid, $scope, null, grid.columns[8].colDef);

expect(args).toEqual( { x : { percentage : (900 + 200 * 8/10) / 1500 } });
expect(args).toEqual( { grid: grid, x : { percentage : (900 + 200 * 8/10) / 1500 } });
});

it('should request no scroll as no row or column', function () {
uiGridCellNavService.scrollTo( grid, $scope, null, null );

expect(args).toEqual(null);
expect(args).toEqual( null );
});
});
});
@@ -254,6 +254,11 @@
if (args.target && (args.target === $elm || angular.element(args.target).hasClass('ui-grid-native-scrollbar'))) {
return;
}

// Don't listen to scrolls from other grids
if (args.grid && args.grid.id !== grid.id){
return;
}

// Set the source of the scroll event in our scope so it's available in our 'scroll' event handler
$scope.scrollSource = args.target;
@@ -74,6 +74,11 @@
}

function scrollHandler (evt, args) {
// exit if not for this grid
if (args.grid && args.grid.id !== grid.id){
return;
}

// Vertical scroll
if (args.y && $scope.bindScrollVertical) {
containerCtrl.prevScrollArgs = args;
@@ -117,6 +117,7 @@
/* Event Methods */

self.fireScrollingEvent = gridUtil.throttle(function(args) {
args.grid = args.grid || self.grid;
$scope.$broadcast(uiGridConstants.events.GRID_SCROLL, args);
}, self.grid.options.scrollThrottle, {trailing: true});

No commit comments for this range

You can’t perform that action at this time.