9 * @class Roo.bootstrap.Pagination
10 * @extends Roo.bootstrap.Component
11 * Bootstrap Pagination class
12 * @cfg {String} size xs | sm | md | lg
13 * @cfg {Boolean} inverse false | true
14 * @cfg {Number} from pagination starting number
15 * @cfg {Number} to pagination ending number
16 * @cfg {String} align empty or left | right
17 * @cfg {Number} active active page number
18 * @cfg {Boolean} preventDefault (true | false) default true
21 * Create a new Pagination
22 * @param {Object} config The config object
25 Roo.bootstrap.Pagination = function(config){
26 Roo.bootstrap.Pagination.superclass.constructor.call(this, config);
31 * The raw click event for the entire grid.
32 * @param {Roo.EventObject} e
38 Roo.extend(Roo.bootstrap.Pagination, Roo.bootstrap.Component, {
49 getAutoCreate : function(){
56 cfg.cls += ' inverse';
75 var from=this.from>0?this.from:1;
76 var to=this.to-from<=10?this.to:from+10;
77 var active=this.active>=from&&this.active<=to?this.active:null;
78 for (var i=from;i<=to;i++) {
82 cls: active===i?'active':'',
111 initEvents: function() {
113 Roo.each(this.el.select('li > a',true).elements, function(v){
114 v..on('click', this.onClick, this);
118 onClick : function(e)
120 Roo.log('pagination on click ');
121 if(this.preventDefault){
125 this.fireEvent('click', this, e);