I've already written a plugin for bootstrap, it can be used creating pagination dynamicly, the usage should be like this:
var options = {
pageRows:page_nums
, onChange:callback
, next: 'Next'
, prev: 'Prev'
, length: 10
, initLoad: false
}
$('#pagination').pagination(options);
$('#pagination').pagination('show', total, start);
pageRows will be numbers of rows per page
total will be the total numbers of records you want to display
start will be the current page number you want to display, and the
first page will be 1
onChange will be called when the "prev", "next", and "page" clicked,
and page number will be passed to it. So you can use it to reload the
content.
If you want to load a page manully, you can do like this:
$('#pagination').pagination('load', page);
Hope it can be some useful. And It doesn't support First, Last, Page
Number input directly.
--
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
UliWeb <<simple web framework>>: http://code.google.com/p/uliweb/
My Blog: http://hi.baidu.com/limodou
bootstrap-pagination.js
Description: JavaScript source
