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 false
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);
32 * The raw click event for the entire grid.
33 * @param {Roo.EventObject} e
39 Roo.extend(Roo.bootstrap.Pagination, Roo.bootstrap.Component, {
48 preventDefault : false,
50 getAutoCreate : function(){
57 cfg.cls += ' inverse';
63 cfg.cls += " " + this.cls;
76 var from=this.from>0?this.from:1;
77 var to=this.to-from<=10?this.to:from+10;
78 var active=this.active>=from&&this.active<=to?this.active:null;
79 for (var i=from;i<=to;i++) {
83 cls: active===i?'active':'',
112 initEvents: function() {
113 this.el.on('click', this.onClick, this);
116 onClick : function(e)
118 Roo.log('pagination click');
120 if(this.preventDefault){
124 this.fireEvent('click', this, e);