Roo/bootstrap/Column.js
[roojs1] / Roo / bootstrap / Column.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} xs colspan out of 12 for mobile-sized screens
13  * @cfg {Number} sm colspan out of 12 for tablet-sized screens
14  * @cfg {Number} md colspan out of 12 for computer-sized screens
15  * @cfg {Number} lg colspan out of 12 for large computer-sized screens
16  * @cfg {String} html content of column.
17  * 
18  * @constructor
19  * Create a new Column
20  * @param {Object} config The config object
21  */
22
23 Roo.bootstrap.Column = function(config){
24     Roo.bootstrap.Column.superclass.constructor.call(this, config);
25 };
26
27 Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component,  {
28     
29     xs: null,
30     sm: null,
31     md: null,
32     lg: null,
33     html: '',
34     offset: 0,
35     
36     getAutoCreate : function(){
37         var cfg = Roo.apply({}, Roo.bootstrap.Column.superclass.getAutoCreate.call(this));
38         
39         cfg = {
40             tag: 'div',
41             cls: 'column'
42         };
43         
44         var settings=this;
45         ['xs','sm','md','lg'].map(function(size){
46             if (settings[size]) {
47                 cfg.cls += ' col-' + size + '-' + settings[size];
48             }
49         });
50         if (this.html.length) {
51             cfg.html = this.html;
52         }
53         
54         return cfg;
55     }
56    
57 });
58
59  
60
61