您的位置:首页 > Web前端 > AngularJS

ngGrid checkbox应用

2015-08-27 15:23 567 查看
 $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);

                               });

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ngGrid angularjs