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);
});
}
}
$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);
});
}
}
相关文章推荐
- angularJS 中$attrs方法使用指南
- 简述AngularJS相关的一些编程思想
- AngularJS的一些基本样式初窥
- 创建你的第一个AngularJS应用的方法
- 详解AngularJS中的作用域
- 简介AngularJS的视图功能应用
- AngularJS语法详解
- angularjs中的e2e测试实例
- 简介AngularJS中使用factory和service的方法
- AngularJS + Node.js + MongoDB开发的基于高德地图位置的通讯录
- 举例讲解AngularJS中的模块
- 使用AngularJS处理单选框和复选框的简单方法
- AngularJS的内置过滤器详解
- 详解AngularJS中自定义指令的使用
- 使用Raygun来自动追踪AngularJS中的异常
- angularJS结合canvas画图例子
- 教你用AngularJS框架一行JS代码实现控件验证效果
- AngularJS入门教程(零):引导程序
- AngularJS基础学习笔记之简单介绍
- 简介AngularJS的HTML DOM支持情况