//初始化无限滚动分页组件
var InitInfiniteScroll = function(){
var _url = _ctx + '/wtbook/getWrongPicThemeDetail.action?currentpage_num=';
var _param = '&pageSize='+PAGE_SIZE
+'&user_ids='+$("#user_ids").val()
+'&subject_id='+$("#subject_id").val()
+'&un_remark_ken=' + $("#un_remark_ken").val()
+'&start='+$("#start").val()
+'&end='+$("#end").val();
$("#pic_list_area").infinitescroll({
navSelector: "#navigation", //导航的选择器,会被隐藏
nextSelector: "#navigation a:first", //包含下一页链接的选择器
itemSelector: "div", //你将要取回的选项(内容块)
debug: false, //启用调试信息
animate: true, //当有新数据加载进来的时候,页面是否有动画效果,默认没有
extraScrollPx: 50, //滚动条距离底部多少像素的时候开始加载,默认150
bufferPx: 40, //载入信息的显示时间,时间越大,载入信息显示时间越短
binder: $(window),
state : {
currPage : 0
},
maxPage:1,//默认只加载第一页
errorCallback: function() {
Modal.warning('提示','未查到错题信息!');
}, //当出错的时候,比如404页面的时候执行的函数
localMode: true, //是否允许载入具有相同函数的页面,默认为false
dataType: 'json',//可以是json
template : function(data){
var $el = '';
if(data.code == '+1000') {
if(!StringUtil.isEmpty(data.body.resultList)) {
$("#pic_list_area").infinitescroll('update',{maxPage:data.body.maxPage});
$.each(data.body.resultList,function(i,n){
$el = getPicThemeShowHtml(n);
//分页最后一个交给插件处理,其它手动添加到页面中
if(i != data.body.resultList.length-1) {
$el.appendTo($("#pic_list_area"));
}
});
}
}else{
Modal.warning('提示','系统异常,请刷新重试!!!!');
}
return $el;
},
pathParse:function(path,nextPage){
return [_url,_param];
},
loading: {
msgText: "<em>加载中...</em>",
finishedMsg: '<em>没有新数据了</em>',
speed: 'fast',
selector: null // 显示loading信息的div
}
}, function(newElems) {
//程序执行完的回调函数
if(_pic_list_area.find('input:checkbox').length > 0) {
$("#delete_btn").show();
}
});
};
jsp mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
<%-- SITEMESH-JSP默认模板页面
本模板页面可用于使用sitemesh装饰的业务内容页,
只需要填入“title、head、page-content、footer”的内容即可 --%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/modules/common/include/consts.jsp"%>
<!DOCTYPE html>
<html lang="zh">
<head>
<title>编辑错题本<%-- 页面标题 --%></title>
<%-- head begin --%>
<%-- 每个页面独立的head内容 --%>
<link href="${wsf}/static/wrong/css/metro.min.css" rel="stylesheet">
<link href="${wsf}/static/wrong/css/toastr.min.css" rel="stylesheet" type="text/css">
<%-- head end --%>
</head>
<body>
<%--page begin--%>
<div class="page clearfix">
<div class="breadcrumbs breadcrumbs-fixed">
<ul class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span><a href="${ctx}/user/index.action"> 首页</a></li>
<li>错题本印制</li>
<li>${school_name }</li>
</ul>
</div>
<div class="col-md-12">
<button class="btn btn-paimary" onclick="history.back();">
<i class="glyphicon glyphicon-chevron-left"></i>返回
</button>
<h4 class="text-align-center"><span id="user_name_span" class="margin-right-5">XXX</span><small><span id="subject_span">xx</span>错题</small><small class="silver margin-left-5 margin-right-20">共 <span id="sum_wrong_num_span">0</span> 道错题</small></h4>
</div>
<div class="col-md-12 margin-bottom-10"><span class="fr"><button id="delete_btn" style="display:none" class="btn btn-danger margin-right-5">删除</button><button id="check_all_btn" name="check_all_btn" class="btn btn-primary margin-right-5">全选</button></span></div>
<!-- <button id="cancle_check_all_btn" class="btn btn-primary">取消选中</button> -->
<div id="pic_list_area">
</div>
<div id="navigation"><a href="${ctx}/wtbook/getWrongPicThemeDetail.action?currentpage_num=&user_ids=${user_ids }&subject_id=${subject_id }&un_remark_ken=${un_remark_ken }&start=${start }&end=${end}"></a></div>
</div>
<%--page end--%>
<!--查看大图 begin-->
<div class="modal fade" id="wrongtheme_bigpic_div">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span>
</button>
<h4 class="modal-title">错题</h4>
</div>
<div class="modal-body text-align-center">
<img src="" alt="">
</div>
</div>
</div>
</div>
<!--查看大图 end-->
<form action="" method="post" id="list_form">
<input type="hidden" id="grade" name="grade" value="${grade }">
<input type="hidden" id="school_name" name="school_name" value="${school_name }">
<input type="hidden" id="user_id" name="user_id" value="${user_id }">
<input type="hidden" id="user_ids" name="user_ids" value="${user_ids }">
<input type="hidden" id="created_user_ids" name="created_user_ids" value="${created_user_ids }">
<input type="hidden" id="user_name" name="user_name" value="${user_name }">
<input type="hidden" id="start" name="start" value="${start }">
<input type="hidden" id="end" name="end" value="${end }">
<input type="hidden" id="subject_id" name="subject_id" value="${subject_id }">
<input type="hidden" id="un_remark_ken" name="un_remark_ken" value="${un_remark_ken }">
</form>
<%-- footer begin --%>
<footer>
<%-- 页面中需要的javascript代码或者直接在此引入js --%>
<script type="text/javascript" src="${wsf}/static/yjgl/js/jquery.infinitescroll.js"></script>
<script type="text/javascript" src="${wsf}/static/wrong/js/toastr.js"></script>
<script type="text/javascript" src="${ctx }/modules/wrongthemebook/checklist.js"></script>
<script type="text/javascript">
jQuery(document).ready(function () {
checklist.init();
});
</script>
</footer>
<%-- footer end --%>
</body>
</html>