app.controller("baseController",function ($scope) {
//获取2个分页参数,网页数据传后台
$scope.reloadlist=function () {
$scope.search($scope.paginationConf.currentPage,$scope.paginationConf.itemsPerPage);
}
//分页控件
$scope.paginationConf= {
//赋值就会发生变化,变化就执行下面的onchange激发一连串的变化
currentPage: 1, //默认目前页码
totalItems: 0, //默认总条数
itemsPerPage: 10, //默认每页条数
perPageOptions: [5,10, 20, 30, 40, 50], //每页展示条数选择
//onChange只要上面默认发生变化就更新,调用reloadlist
onChange:function () {
$scope.reloadlist();//重新加载,查询
}
}
//收集ids
$scope.selectIds=[];
//更新复选
$scope.updateSelection=function ($event,id) {
if($event.target.checked){
$scope.selectIds.push(id);
}else {
var idx= $scope.selectIds.indexOf(id); //拿到此id的下标
$scope.selectIds.splice(idx,1); //从集合中删除此id
}
}
});版权声明:本文为weixin_42333583原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。