ngGrid checkbox应用

来源:互联网 发布:jquery点击事件源码 编辑:程序博客网 时间:2024/05/18 18:01

 $scope.mySelections = []; //初始化复选框的值


$scope.gridOptions = {


       data: 'LDTLInfos',//列表的原始数据
       rowTemplate: '<div style="height: 100%"><div ng-style="{ \'cursor\': row.cursor }" ng-repeat="col in renderedColumns" ng-class="col.colIndex()" class="ngCell ">' +
           '<div class="ngVerticalBar" ng-style="{height: rowHeight}" ng-class="{ ngVerticalBarVisible: !$last }"> </div>' +
           '<div ng-cell></div>' +
           '</div></div>',
           enableRowSelection: true,
           enableCellEditOnFocus: true,
           showSelectionCheckbox: true,

           selectedItems:$scope.mySelections,//声明复选框选中所获取值

           enablePinning: true,
           checkboxHeaderTemplate:"<div></div>",
       columnDefs: [{
           field: 'acode',
           displayName: '代码',
           enableCellEdit: false,
           width:80
       }
       
       ],
       enablePaging: false,
       showFooter: false
     

   };

//以下是我的提交按钮

$scope.submitYLZForm=function(isValid){

if(isValid){
//遍历被选中复选框的值
angular.forEach($scope.mySelections,function(item){
   consolo.log(item);

                               });

}


}



0 0
原创粉丝点击