jeudi 29 juin 2017

How to avoid checkbox being selected when clicking on table row

I have a table with one of the columns a checkbox that I need to activate or not depending on a certain logic.

My problem is even when the checkbox is deactivated, when I click away from the checkbox, at the table row, the checkbox get selected.

What is best approach to fix this? Make the row tables deactivated too?

 <table st-safe-src="sampleOverview.dataSet" st-table="sampleOverview.displayed" class="table table-striped">
    <tr ng-repeat="sample in sampleOverview.displayed track by $index" ng-click="sample.selected = !sample.selected" ng-class="{success: sample.selected, warning : sample.deviceId == null || sample.methodId == null }" ng-disabled="sample.deviceId == null || sample.methodId == null">
                <td class="hidden-xs hidden-sm"></td>
                <td class="hidden-xs hidden-sm"></td>
                <td></td>
                <td></td>
                <td></td>
                <td class="text-center hidden-xs hidden-sm">
                    <input type="checkbox" ng-model="sample.selected" ng-click="sampleOverview.selectSample($event, sample)" ng-disabled="sample.deviceId == null || sample.methodId == null">
                </td>
            </tr>
        </tbody>
    </table>

enter image description here




Aucun commentaire:

Enregistrer un commentaire