對于分頁模板除了首頁顯示以外其他點(diǎn)擊在此給分頁模板追加內(nèi)容需要判定是否已經(jīng)初始化
$('#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()
}
}
}
});
})