对于分页模板除了首页显示以外其他点击在此给分页模板追加内容需要判定是否已经初始化
$('#newruleadd').click(function(){
$("#newruleadddetail").modal("show");
if($('#week_label').pagination()){
$('#week_label').pagination('destroy');
}
$("#week_label").pagination({
pageIndex: 0,
pageSize: 5,
pageBtnCount : 9,
firstBtnText : "首页",
lastBtnText : "尾页",
prevBtnText : "上一页",
nextBtnText :"下一页",
remote:{
url:'http://localhost:8080/scheduling/newruleadd',
success:function(res){
let html=template("week_html",res);
$('#week').html("");
$('#week').append(html);
},
totalName:'total',
pageParams:function(data){
return{
pageIndex:data.pageIndex,
pageSize:data.pageSize,
deptname:$('select[name=deptname] option:selected').text(),
registName:$('select[name=registName] option:selected').text()
}
}
}
});
})