daniel-nagy / md-data-table

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

activate all rows together #524

Closed diegoberges closed 7 years ago

diegoberges commented 7 years ago

I have a problem, when I click in one row, all rows change to active. Why?

This is my code.

<md-card>
  <md-content layout="column" flex>
    <md-table-container>
      <table md-table md-row-select="true" multiple="true" ng-model="selected">
        <thead md-head md-order="query.order">
          <tr md-row>
            <th md-column ng-repeat="column in autocolumn" md-order-by="{{column.name}}">
              <span>{{column.display}}</span>
            </th>
          </tr>
        </thead>
        <tbody md-body>
          <tr md-row md-select="row" md-auto-select="true" ng-repeat="cliente in clientes | orderBy: query.order | limitTo: query.limit : (query.page -1) * query.limit">
            <td md-cell>{{cliente.1}}</td>
            <td md-cell><a ng-click="send(this);">{{cliente.2}}</a></td>
            <td md-cell nowrap>{{cliente.3}}</td>
            <td md-cell nowrap>{{cliente.4}}</td>
            <td md-cell>{{cliente.5}}</td>
            <td md-cell>{{cliente.6}}</td>
          </tr>
        </tbody>
      </table>
    </md-table-container>
    <md-table-pagination md-limit="query.limit" md-limit-options="limitOptions" md-page="query.page" md-total="{{datatable.count}}" md-page-select="options.pageSelect"></md-table-pagination>
  </md-content>
</md-card>
diegoberges commented 7 years ago

Change row by cliente

<tbody md-body>
          <tr md-row md-select="cliente" md-auto-select="true" ng-repeat="cliente in clientes | orderBy: query.order | limitTo: query.limit : (query.page -1) * query.limit">
            <td md-cell>{{cliente.1}}</td>
            <td md-cell><a ng-click="send(this);">{{cliente.2}}</a></td>
            <td md-cell nowrap>{{cliente.3}}</td>
            <td md-cell nowrap>{{cliente.4}}</td>
            <td md-cell>{{cliente.5}}</td>
            <td md-cell>{{cliente.6}}</td>
          </tr>
        </tbody>