Roo/bootstrap/Pagination.js
[roojs1] / Roo / bootstrap / Pagination.js
1 /*
2  * - LGPL
3  *
4  * column
5  * 
6  */
7
8 /**
9  * @class Roo.bootstrap.Column
10  * @extends Roo.bootstrap.Component
11  * Bootstrap Column class
12  * @cfg {number} colspan  Number of columsn to span
13  * 
14  * @constructor
15  * Create a new Column
16  * @param {Object} config The config object
17  */
18
19 Roo.bootstrap.Pagination = function(config){
20     Roo.bootstrap.Pagination.superclass.constructor.call(this, config);
21 };
22
23 Roo.extend(Roo.bootstrap.Pagination, Roo.bootstrap.Component,  {
24     
25     html: false,
26     cls: false,
27     size: false,
28     inverse: false,
29     from: 1,
30     to: 4,
31     align: false,
32     active: 1,
33     
34     getAutoCreate : function(){
35         cfg = {
36             tag: 'ul',
37             cls: 'pagination',
38             cn: []
39         }
40         if (this.inverse) {
41             cfg.cls += ' inverse'
42         }
43         if (this.html) {
44             cfg.html=this.html
45         }
46         if (this.cls) {
47             cfg.cls=this.cls
48         }
49         cfg.cn[0]={
50             tag: 'li',
51             cn: [
52                 {
53                     tag: 'a',
54                     href:'#',
55                     html: '«'
56                 }
57             ]
58         }
59         
60         for (var i=this.from;i++;i<this.to) {
61             cfg.cn.push(
62                 {
63                     tag: 'li',
64                     cn: [
65                         {
66                             tag: 'a',
67                             href: '#',
68                             html: i
69                         }
70                     ]
71                 }
72             )
73         }
74         
75         cfg.cn.push(
76             {
77                 tag: 'li',
78                 cn: [
79                     {
80                        tag: 'a',
81                        href: '#',
82                        html: '&raquo;'
83                     }
84                 ]
85             }
86         )
87         
88         return cfg;
89     }
90    
91 });
92
93  
94
95