0

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 cellNav 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 grid.appScope?

CozyAzure
  • 8,280
  • 7
  • 34
  • 52
Envy
  • 510
  • 6
  • 19

1 Answers1

1

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]

panzhuli
  • 2,890
  • 6
  • 33
  • 46