doubt with checkbox / angular

Asked

Viewed 123 times

0

Guys I got this table:

<table class="uk-table uk-table-nowrap">
                        <thead>
                        <tr>
                            <th class="uk-width-1-10 uk-text-center small_col"><input type="checkbox" icheck ng-model="table1.selectAll" class="check_all" table-check-all></th>
                            <th class="uk-width-1-10 uk-text-center">User Image</th>
                            <th class="uk-width-2-10">User Name</th>
                            <th class="uk-width-2-10 uk-text-center">Order Number</th>
                            <th class="uk-width-1-10 uk-text-center">Order Date</th>
                            <th class="uk-width-1-10 uk-text-center">Status</th>
                            <th class="uk-width-2-10 uk-text-center">Actions</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td class="uk-text-center uk-table-middle small_col"><input type="checkbox" icheck ng-model="table.row1" class="check_row" table-check-row></td>
                            <td class="uk-text-center"><img class="md-user-image" ng-src="assets/img/avatars/avatar_01_tn.png" alt=""/></td>
                            <td>Valerie Barton</td>
                            <td class="uk-text-center">55/2015</td>
                            <td class="uk-text-center">13-11-1997</td>
                            <td class="uk-text-center"><span class="uk-badge uk-badge-success">Shipped</span></td>
                            <td class="uk-text-center">
                                <a href="#"><i class="md-icon material-icons">&#xE254;</i></a>
                                <a href="#"><i class="md-icon material-icons">&#xE88F;</i></a>
                            </td>
                        </tr>                         
                        <tr>
                            <td class="uk-text-center uk-table-middle small_col"><input type="checkbox" icheck ng-model="table.row7" class="check_row" table-check-row></td>
                            <td class="uk-text-center"><img class="md-user-image" ng-src="assets/img/avatars/avatar_07_tn.png" alt=""/></td>
                            <td>Maximus Walsh</td>
                            <td class="uk-text-center">69/2015</td>
                            <td class="uk-text-center">08-05-1976</td>
                            <td class="uk-text-center"><span class="uk-badge uk-badge-success">Shipped</span></td>
                            <td class="uk-text-center">
                                <a href="#"><i class="md-icon material-icons">&#xE254;</i></a>
                                <a href="#"><i class="md-icon material-icons">&#xE88F;</i></a>
                            </td>
                        </tr>
                        <tr>
                            <td class="uk-text-center uk-table-middle small_col"><input type="checkbox" icheck ng-model="table.row8" class="check_row" table-check-row></td>
                            <td class="uk-text-center"><img class="md-user-image" ng-src="assets/img/avatars/avatar_08_tn.png" alt=""/></td>
                            <td>Zella Cummings</td>
                            <td class="uk-text-center">25/2015</td>
                            <td class="uk-text-center">14-01-1982</td>
                            <td class="uk-text-center"><span class="uk-badge uk-badge-primary">New</span></td>
                            <td class="uk-text-center">
                                <a href="#"><i class="md-icon material-icons">&#xE254;</i></a>
                                <a href="#"><i class="md-icon material-icons">&#xE88F;</i></a>
                            </td>
                        </tr>
                        </tbody>
                    </table>

Here an example of it working: inserir a descrição da imagem aqui

As this, allows to select several checkbox (multiselect), I need when selecting a checkbox, uncheck all others, ie not be multiselect, how can I do this?

  • The behavior you seek is the same behavior as the radio button. Put your JS there, so you can answer better

  • fernandoocf, na vdd exite JS, just a checkbox was included in the table

  • then there’s nothing angular there, correct?

  • changes the input type to type="checkbox"

  • angular, so far only ng-repeat, and the type is already checkbox, you mean radiobuttom? i need q to be a checkbox, because at some point I want to be able to be multiselect, that is, have a button that enables/disables multiselect

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.