0
我正在使用twbsPagination,並且遇到以下問題。twbsPagination插件問題
onPageClick
在我銷燬並初始化諸如totalpages之類的新選項後,事件永遠不會觸發。
這裏是我的代碼:
function ShowPages(update, TotalPages) {
if (update) {
var $pagination = $('#pagination');
var defaultOpts = {
totalPages: 10
};
var currentPage = $pagination.twbsPagination('getCurrentPage');
$pagination.twbsPagination('destroy');
$pagination.twbsPagination($.extend({}, defaultOpts, {
startPage: currentPage,
totalPages: TotalPages,
first: '<span> <i class="ace-icon fa fa-angle-double-left bigger-140"></i> </span>',
prev: '<span> <i class="ace-icon fa fa-angle-left bigger-150"></i></i></span>',
next: '<span> <i class="ace-icon fa fa-angle-right bigger-150"></i></i></span>',
last: '<span> <i class="ace-icon fa fa-angle-double-right bigger-140"></i></span>'
}));
}
else {
$('#pagination').twbsPagination({
totalPages: TotalPages,
visiblePages: 7,
first: '<span> <i class="ace-icon fa fa-angle-double-left bigger-140"></i> </span>',
prev: '<span> <i class="ace-icon fa fa-angle-left bigger-150"></i></i></span>',
next: '<span> <i class="ace-icon fa fa-angle-right bigger-150"></i></i></span>',
last: '<span> <i class="ace-icon fa fa-angle-double-right bigger-140"></i></span>',
onPageClick: function (event, page) {
GetMyTasks(page);
}
});
}
}