0
私はui-gridを使ってパーミッションを表示しています。選択されたチェックボックスとすべてのチェックボックスselection.Nowと同じように、ヘッダーにチェックボックスを追加し、クリックした後はすべて下のチェックボックスをオンにし、allを選択解除したいと思っています。 。 これは私がui-grid anglejsのヘッダにチェックボックスを追加するには
angular.forEach($scope.moduleRoles, function (role, key) {
$scope.mgridOptions.columnDefs.push({name: role, displayName: role, width: 150,headerCellTemplate: "<span> \
<span ng-class=\"'colt' + col.index\" class=\"ngHeaderText\"> \
{{col.displayName}} \
'<input type=\"checkbox\" ng-model=\"role.checked\" class=\"chckBox\" ng-click=\"checkAll(role.checked);\">' \
</span> \
</span>" , cellTemplate: '<input type="checkbox" ng-model="row.entity.roles[\'' + key + '\'].selected" ng-click="grid.appScope.updateModulePerms(row.entity,\'' + key + '\')">'});
});
$ scope.moduleRolesをしようとしているコードでは、サーバーから役割データが含まれています。 ヘッダーにチェックボックスを追加できます。ただし、checkAll関数が機能していないため、チェックボックスのデザインを変更できません。
$scope.optionsGrid = {
enableSelectAll: true,
enableRowHeaderSelection: true
}
をして、行選択イベントのコールバック関数ハンドラを追加します:私はwrong.Please助け