ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

ngGridEventData firing twice

Open TomMorgen opened this issue 12 years ago • 5 comments

No sure if this is a bug or intended. Look at this discussion on SO: http://stackoverflow.com/questions/23419722/ng-grid-why-is-afterselectionchange-called-twice/23426604?noredirect=1#comment35989024_23426604

Is this intended? It seems to me the first line of this block is not necessary:

 $scope.$on('$destroy', $scope.$parent.$watch(options.data, dataWatcher));
 $scope.$on('$destroy', $scope.$parent.$watch(options.data + '.length', function() {
           dataWatcher($scope.$eval(options.data));
$scope.adjustScrollTop(grid.$viewport.scrollTop(), true);
                        }));

This is the first time I try to submit a bug, please be kind to me if I do everything wrong.

TomMorgen avatar May 05 '14 13:05 TomMorgen

I think so too.

junkoro avatar Jun 12 '14 05:06 junkoro

Potential duplicate of #585, which has a solution provided. Closing.

PaulL1 avatar Sep 08 '14 09:09 PaulL1

Hello @PaulL1, I am using the latest version and I still see this problem. #585 closed on 24 Apr.

In my case, I can see that the method below is being fired twice

gridOptions.afterSelectionChange = function (rowItem) ....

Can I open another Issue?

thank you

jullierme avatar Sep 16 '14 01:09 jullierme

Is it possible to just use a debounce? When you say latest version, I presume that means 2.x? Is it worth looking at 3.0 to see if this issue persists there (3.0 being very different of course) - if it can be resolved with a debounce then probably it wouldn't get fixed in 2.x given that 3.0 is getting close.

PaulL1 avatar Sep 16 '14 01:09 PaulL1

Yes, it is 2.0.13.

I'll check the version 3.0

thank you

jullierme avatar Sep 16 '14 01:09 jullierme