trNgGrid icon indicating copy to clipboard operation
trNgGrid copied to clipboard

selected-items not working

Open tedjt opened this issue 12 years ago • 5 comments

I have the following structure but I can't seem to get the selectedItems to update

<div ng-controller="TableController">
<p ng-bind="mySelectedItems"></p>
<table tr-ng-grid="" items="items" page-items="10" selected-items="mySelectedItems" enable-multi-row-selections="true" enable-selections="true">
</table>
</div>
myApp.controller('TableController', function($scope) {
  $scope.items = [{key:value}...]
})

mySelectedItems never seems to get updated - am I doing something wrong?

tedjt avatar May 21 '14 20:05 tedjt

Also - just noticed that page html adds the ng-isolate-scope class to the table element. I'm not sure where that's happening but I'm guessing that could be the cause? <table .... class='tr-ng-grid table table-bordered table-hover ng-isolate-scope'>

tedjt avatar May 21 '14 21:05 tedjt

I figured this out.

tedjt avatar May 22 '14 06:05 tedjt

What did you do for fix this issue ? i have the same problem

stalinb87 avatar Jul 22 '14 18:07 stalinb87

I already fix it, just add an object to selected-items="obj.selecteditems"

stalinb87 avatar Jul 22 '14 18:07 stalinb87

I bet that if you created your scoped bound array straight in your controller,where you initialize the scope, you wouldn't have this problem. scope.mySelectedItems=[];

MoonStorm avatar Jul 24 '14 16:07 MoonStorm