daniel-nagy / md-data-table

Material Design Data Table for Angular Material
MIT License
1.9k stars 519 forks source link

Multiple Tables in ng-repeat selection issue #474

Open uday4393 opened 8 years ago

uday4393 commented 8 years ago

Hi, Great material table plugin

I am rendering three tables using ng-repeat( headings, rows, cells also using ng-repeat). When I select one item in a row, all individual items in all tables are getting selected. In a nutshell, I am unable to differentiate between tables. Please help, Thanks

TeknoloGenie commented 8 years ago

Im going to go out on a limb here and ask, did you insure that each time you repeat a table you are giving the ng-model attribute a different property?

example: (forgive me if my syntax on the html/handlebars is wrong, just waking up)

<table  ng-repeat="table in tables track by $index" md-table md-row-select multiple ng-model="selected_{{$index}}" md-progress="promise">
... 
</table>

then on your controller

$scope.selected_1 = [];
$scope.selected_2 = []; 
$scope.selected_3 = [];

Hopefully this isn't your issue though, because its not md-data-table related. Its Angular basics.

edit: If you have already tried this can you make a JSFiddle or post your code here.