Envy Envy - 4 months ago 37x
AngularJS Question

Cannot get right value when use external scope function in angular-ui-grid

I am using angularjs 1.4.9 and ui-grid 3.1.1

I have used external scope (grid.appScope) to access a function to get value from a cell in grid but I can not get the right value.

The plunker: plnkr.co/edit/f0c24q5w9Fbx9ap1XUG7?p=preview

If we click on image of Product 01 to Product 05 we can get the right value, the image will display normally, but if we click on image of Product 20 - Product 23 we can not see the right image.

If we click on one cell (use the

feature) and click on the button "Get current focus cell" we always get the right value.

So how can I get the true value through


The issue is that the items beneath the visible table have a VERY hard time keeping up. Try this plunkr

The code that changed:

var imageTemplate = '<div class="ui-grid-cell-contents" ng-if="!!row.entity.image" style="text-align: center">'
  + '<img ng-src={{row.entity.image}} width="50px" height="50px" ng-click="grid.appScope.addImage(row.entity.image)"/></div>';

[note I removed the quotes]