angular中表格的全选,单选的互相控制
直接上代码:
结构:
底价货号 供应商 仓库 无数据 {{list.id}} {{list.supplierName}} {{list.storeName}}
逻辑
//勾选$scope.allSelect = function () {if($scope.all){$scope.floorPriceTable.forEach(function (value) {value.selectedStatus = true;});}else{$scope.floorPriceTable.forEach(function (value) {value.selectedStatus = false;});}};$scope.listSelect = function (param) {if(param.selectedStatus){$scope.all = true;$scope.floorPriceTable.forEach(function (value) {if(!value.selectedStatus){$scope.all = false}});}else{$scope.all = false}}//勾选了哪些货品$scope.selectResult = function(){console.log($scope.floorPriceTable)var idList = [];$scope.floorPriceTable.forEach(function(value){if(value.selectedStatus){idList.push(value.id);}})console.log(idList)return idList }
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
