4 * base class for bootstrap elements.
8 Roo.bootstrap = Roo.bootstrap || {};
10 * @class Roo.bootstrap.Component
11 * @extends Roo.Component
12 * Bootstrap Component base class
13 * @cfg {String} cls css class
14 * @cfg {String} style any extra css
17 * Do not use directly - it does not do anything..
18 * @param {Object} config The config object
23 Roo.bootstrap.Component = function(config){
24 Roo.bootstrap.Component.superclass.constructor.call(this, config);
27 Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, {
35 initEvents : function() { },
40 // returns the parent component..
41 return Roo.ComponentMgr.get(this.parentId)
47 onRender : function(ct, position)
49 Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
53 var cfg = Roo.apply({}, this.getAutoCreate());
57 cfg.cls += ' ' + this.cls;
59 if (this.style) { // fixme needs to support more complex style data.
60 cfg.style = this.style;
62 this.el = ct.createChild(cfg, position);
63 if(this.tabIndex !== undefined){
64 this.el.dom.setAttribute('tabIndex', this.tabIndex);
71 getChildContainer : function()
76 addxtype : function (tree, cntr) {
78 cntr = typeof(cntr == 'undefined' ) ? 'getChildContainer' : cntr;
80 if (tree.xtype != 'Body') {
82 cn = Roo.factory(tree);
84 cn.parentType = this.xtype; //??
85 cn.parentId = this.id;
86 cn.render(this[cntr]());
87 // then add the element..
90 if (typeof (tree.menu) != 'undefined') {
91 tree.menu.parentType = cn.xtype;
92 tree.menu.triggerEl = cn.el;
93 nitems.push(cn.addxtype(Roo.apply({}, tree.menu)));
96 if (typeof (tree.buttons) != 'undefined' && typeof(cn.getButtonContainer) == 'function') {
98 for(var i =0;i < tree.buttons.length;i++) {
99 nitems.push(cn.addxtype(Roo.apply({}, tree.buttons[i]), 'getButtonContainer'));
104 if (!tree.items || !tree.items.length) {
108 var items = tree.items;
111 //Roo.log(items.length);
113 for(var i =0;i < items.length;i++) {
114 nitems.push(cn.addxtype(Roo.apply({}, items[i])));
134 Roo.bootstrap.Body = function(config){
135 Roo.bootstrap.Body.superclass.constructor.call(this, config);
138 Roo.extend(Roo.bootstrap.Body, Roo.bootstrap.Component, {
143 onRender : function(ct, position){
144 this.el = Roo.get(document.body);
146 //this.el.addClass([this.fieldClass, this.cls]);
164 * @class Roo.bootstrap.ButtonGroup
165 * @extends Roo.bootstrap.Component
166 * Bootstrap ButtonGroup class
167 * @cfg {String} size lg | sm | xs (default empty normal)
168 * @cfg {String} align vertical | justified (default none)
169 * @cfg {String} direction up | down (default down)
170 * @cfg {Boolean} toolbar false | true
171 * @cfg {Boolean} btn true | false
176 * @param {Object} config The config object
179 Roo.bootstrap.ButtonGroup = function(config){
180 Roo.bootstrap.ButtonGroup.superclass.constructor.call(this, config);
183 Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component, {
191 getAutoCreate : function(){
197 cfg.html = this.html || cfg.html;
208 if (['vertical','justified'].indexOf(this.align)!==-1) {
209 cfg.cls = 'btn-group-' + this.align;
211 if (this.align == 'justified') {
212 console.log(this.items);
216 if (['lg','sm','xs'].indexOf(this.size)!==-1) {
217 cfg.cls += ' btn-group-' + this.size;
220 if (this.direction == 'up') {
221 cfg.cls += ' dropup' ;
237 * @class Roo.bootstrap.Button
238 * @extends Roo.bootstrap.Component
239 * Bootstrap Button class
240 * @cfg {String} html The button content
241 * @cfg {String} weight default (or empty) | primary | success | info | warning | danger
242 * @cfg {String} size empty | lg | sm | xs
243 * @cfg {String} tag empty | a | input | submit
244 * @cfg {String} href empty or href
245 * @cfg {Boolean} disabled false | true
246 * @cfg {Boolean} isClose false | true
247 * @cfg {String} glyphicon empty | adjust | align-center | align-justify | align-left | align-right | arrow-down | arrow-left | arrow-right | arrow-up | asterisk | backward | ban-circle | barcode | bell | bold | book | bookmark | briefcase | bullhorn | calendar | camera | certificate | check | chevron-down | chevron-left | chevron-right | chevron-up | circle-arrow-down | circle-arrow-left | circle-arrow-right | circle-arrow-up | cloud | cloud-download | cloud-upload | cog | collapse-down | collapse-up | comment | compressed | copyright-mark | credit-card | cutlery | dashboard | download | download-alt | earphone | edit | eject | envelope | euro | exclamation-sign | expand | export | eye-close | eye-open | facetime-video | fast-backward | fast-forward | file | film | filter | fire | flag | flash | floppy-disk | floppy-open | floppy-remove | floppy-save | floppy-saved | folder-close | folder-open | font | forward | fullscreen | gbp | gift | glass | globe | hand-down | hand-left | hand-right | hand-up | hd-video | hdd | header | headphones | heart | heart-empty | home | import | inbox | indent-left | indent-right | info-sign | italic | leaf | link | list | list-alt | lock | log-in | log-out | magnet | map-marker | minus | minus-sign | move | music | new-window | off | ok | ok-circle | ok-sign | open | paperclip | pause | pencil | phone | phone-alt | picture | plane | play | play-circle | plus | plus-sign | print | pushpin | qrcode | question-sign | random | record | refresh | registration-mark | remove | remove-circle | remove-sign | repeat | resize-full | resize-horizontal | resize-small | resize-vertical | retweet | road | save | saved | screenshot | sd-video | search | send | share | share-alt | shopping-cart | signal | sort | sort-by-alphabet | sort-by-alphabet-alt | sort-by-attributes | sort-by-attributes-alt | sort-by-order | sort-by-order-alt | sound-5-1 | sound-6-1 | sound-7-1 | sound-dolby | sound-stereo | star | star-empty | stats | step-backward | step-forward | stop | subtitles | tag | tags | tasks | text-height | text-width | th | th-large | th-list | thumbs-down | thumbs-up | time | tint | tower | transfer | trash | tree-conifer | tree-deciduous | unchecked | upload | usd | user | volume-down | volume-off | volume-up | warning-sign | wrench | zoom-in | zoom-out
248 * @cfg {String} badge text for badge
249 * @cfg {String} theme default (or empty) | glow
250 * @cfg {Boolean} inverse false | true
251 * @cfg {Boolean} toggle false | true
252 * @cfg {String} ontext text for on toggle state
253 * @cfg {String} offtext text for off toggle state
254 * @cfg {Boolean} defaulton true | false
257 * Create a new button
258 * @param {Object} config The config object
262 Roo.bootstrap.Button = function(config){
263 Roo.bootstrap.Button.superclass.constructor.call(this, config);
268 * The raw click event for the entire grid.
269 * @param {Roo.EventObject} e
275 Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, {
294 getAutoCreate : function(){
301 if (['a', 'button', 'input', 'submit'].indexOf(this.tag) < 0) {
302 throw "Invalid value for tag: " + this.tag + ". must be a, button, input or submit.";
307 cfg.html = this.html || cfg.html;
309 if (this.toggle===true) {
317 'data-off-text':'OFF',
318 cls: 'slider-button',
324 if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
325 cfg.cls += ' '+this.weight;
334 cfg["aria-hidden"] = true;
336 cfg.html = "×";
342 if (this.theme==='default') {
345 if (this.parentType != 'Navbar') {
346 this.weight = this.weight.length ? this.weight : 'default';
348 if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
350 cfg.cls += ' btn-' + this.weight;
352 } else if (this.theme==='glow') {
357 if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
359 cfg.cls += ' ' + this.weight;
365 this.cls += ' inverse';
370 cfg.cls += ' active';
373 cfg.cls += this.size.length ? (' btn-' + this.size) : '';
375 //gsRoo.log(this.parentType);
376 if (this.parentType === 'Navbar') {
383 href : this.href || '#'
386 cfg.cn[0].html = this.html + ' <span class="caret"></span>';
387 cfg.cls += ' dropdown';
392 } else if (this.menu) {
394 cfg.cls += ' dropdown test';
400 cfg.disabled = 'disabled';
404 Roo.log('changing to ul' );
406 this.glyphicon = 'caret';
409 if (this.glyphicon) {
410 cfg.html = ' ' + cfg.html;
415 cls: 'glyphicon glyphicon-' + this.glyphicon
441 if (cfg.tag !== 'a' && this.href !== '') {
442 throw "Tag must be a to set href.";
443 } else if (this.href.length > 0) {
444 cfg.href = this.href;
449 initEvents: function() {
450 // Roo.log('init events?');
451 // Roo.log(this.el.dom);
452 this.el.select('a',true).on('click',
454 this.fireEvent('click', this);
470 * @class Roo.bootstrap.Column
471 * @extends Roo.bootstrap.Component
472 * Bootstrap Column class
473 * @cfg {Number} xs colspan out of 12 for mobile-sized screens
474 * @cfg {Number} sm colspan out of 12 for tablet-sized screens
475 * @cfg {Number} md colspan out of 12 for computer-sized screens
476 * @cfg {Number} lg colspan out of 12 for large computer-sized screens
477 * @cfg {String} html content of column.
480 * Create a new Column
481 * @param {Object} config The config object
484 Roo.bootstrap.Column = function(config){
485 Roo.bootstrap.Column.superclass.constructor.call(this, config);
488 Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component, {
497 getAutoCreate : function(){
498 var cfg = Roo.apply({}, Roo.bootstrap.Column.superclass.getAutoCreate.call(this));
506 ['xs','sm','md','lg'].map(function(size){
507 if (settings[size]) {
508 cfg.cls += ' col-' + size + '-' + settings[size];
511 if (this.html.length) {
531 * @class Roo.bootstrap.Container
532 * @extends Roo.bootstrap.Component
533 * Bootstrap Container class
534 * @cfg {Boolean} jumbotron is it a jumbotron element
535 * @cfg {String} html content of element
536 * @cfg {String} well (lg|sm|md) a well, large, small or medium.
537 * @cfg {String} panel (primary|success|info|warning|danger) render as a panel.
538 * @cfg {String} header content of header (for panel)
539 * @cfg {String} footer content of footer (for panel)
543 * Create a new Container
544 * @param {Object} config The config object
547 Roo.bootstrap.Container = function(config){
548 Roo.bootstrap.Container.superclass.constructor.call(this, config);
551 Roo.extend(Roo.bootstrap.Container, Roo.bootstrap.Component, {
559 getChildContainer : function() {
560 if (this.panel.length) {
561 return this.el.select('.panel-body',true).first();
568 getAutoCreate : function(){
574 if (this.jumbotron) {
575 cfg.cls = 'jumbotron';
581 if (this.well.length) {
585 cfg.cls +'well well-' +this.well;
595 if (this.panel.length) {
596 cfg.cls += 'panel panel-' + this.panel;
598 if (this.header.length) {
601 cls : 'panel-heading',
612 if (this.footer.length) {
615 cls : 'panel-footer',
622 body.html = this.html || cfg.html;
639 * @class Roo.bootstrap.Form
640 * @extends Roo.bootstrap.Component
641 * Bootstrap Form class
642 * @cfg {String} method GET | POST (default POST)
643 * @cfg {String} labelAlign top | left (default top)
647 * @param {Object} config The config object
651 Roo.bootstrap.Form = function(config){
652 Roo.bootstrap.Form.superclass.constructor.call(this, config);
655 * @event clientvalidation
656 * If the monitorValid config option is true, this event fires repetitively to notify of valid state
658 * @param {Boolean} valid true if the form has passed client-side validation
660 clientvalidation: true,
663 * Fires when the form is rendered
664 * @param {Roo.form.Form} form
670 Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component, {
673 getAutoCreate : function(){
677 method : this.method || 'POST',
678 id : this.id || Roo.id(),
682 if (this.labelAlign == 'left' ) {
683 cfg.cls += ' form-horizontal';
700 * @class Roo.bootstrap.Img
701 * @extends Roo.bootstrap.Component
702 * Bootstrap Img class
703 * @cfg {Boolean} imgResponsive false | true
704 * @cfg {String} border rounded | circle | thumbnail
705 * @cfg {String} src image source
706 * @cfg {String} alt image alternative text
710 * @param {Object} config The config object
713 Roo.bootstrap.Img = function(config){
714 Roo.bootstrap.Img.superclass.constructor.call(this, config);
717 Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, {
723 getAutoCreate : function(){
727 cls: 'img-responsive',
731 cfg.html = this.html || cfg.html;
733 cfg.src = this.src || cfg.src;
735 if (['rounded','circle','thumbnail'].indexOf(this.border)>-1) {
736 cfg.cls += ' img-' + this.border;
756 * @class Roo.bootstrap.Input
757 * @extends Roo.bootstrap.Component
758 * Bootstrap Input class
759 * @cfg {Boolean} disabled is it disabled
760 * @cfg {String} fieldLabel - the label associated
761 * @cfg {String} inputType button | checkbox | email | file | hidden | image | number | password | radio | range | reset | search | submit | text
762 * @cfg {String} name name of the input
763 * @cfg {boolean} disabled is it disabled
764 * @cfg {string} fieldLabel - the label associated
765 * @cfg {string} inputType - input / file submit ...
766 * @cfg {string} placeholder - placeholder to put in text.
767 * @cfg {string} before - input group add on before
768 * @cfg {string} after - input group add on after
773 * @param {Object} config The config object
776 Roo.bootstrap.Input = function(config){
777 Roo.bootstrap.Input.superclass.constructor.call(this, config);
781 Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component, {
791 getAutoCreate : function(){
793 var parent = this.parent();
795 var align = parent.labelAlign;
800 cls: 'form-group' //input-group
806 type : this.inputType,
807 cls : 'form-control',
808 placeholder : this.placeholder || ''
815 var inputblock = input;
817 if (this.before || this.after) {
826 cls : 'input-group-addon',
830 inputblock.cn.push(input);
834 cls : 'input-group-addon',
842 Roo.log(this.fieldLabel.length);
844 if (align ==='left' && this.fieldLabel.length) {
845 Roo.log("left and has label");
851 cls : 'col-sm-2 control-label',
852 html : this.fieldLabel
863 } else if ( this.fieldLabel.length) {
869 //cls : 'input-group-addon',
870 html : this.fieldLabel
880 Roo.log(" no label && no align");
899 setDisabled : function(v)
901 var i = this.el.select('input',true).dom;
903 i.removeAttribute('disabled');
907 i.setAttribute('disabled','true');
920 * @class Roo.bootstrap.Header
921 * @extends Roo.bootstrap.Component
922 * Bootstrap Header class
923 * @cfg {String} html content of header
924 * @cfg {Number} level (1|2|3|4|5|6) default 1
927 * Create a new Header
928 * @param {Object} config The config object
932 Roo.bootstrap.Header = function(config){
933 Roo.bootstrap.Header.superclass.constructor.call(this, config);
936 Roo.extend(Roo.bootstrap.Header, Roo.bootstrap.Component, {
944 getAutoCreate : function(){
947 tag: 'h' + (1 *this.level),
948 html: this.html || 'fill in html'
966 * @class Roo.bootstrap.Menu
967 * @extends Roo.bootstrap.Component
968 * Bootstrap Menu class - container for MenuItems
969 * @cfg {String} type type of menu
973 * @param {Object} config The config object
977 Roo.bootstrap.Menu = function(config){
978 Roo.bootstrap.Menu.superclass.constructor.call(this, config);
981 Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component, {
989 getChildContainer : function() {
993 getAutoCreate : function(){
995 //if (['right'].indexOf(this.align)!==-1) {
996 // cfg.cn[1].cls += ' pull-right'
1000 cls : 'dropdown-menu'
1004 if (this.type==='submenu') {
1005 cfg.cls='submenu active'
1010 initEvents : function() {
1011 // Roo.log("ADD event");
1012 // Roo.log(this.triggerEl.dom);
1013 this.triggerEl.on('click', this.toggle, this);
1014 this.triggerEl.addClass('dropdown-toggle');
1017 toggle : function(e)
1019 //Roo.log(e.getTarget());
1020 // Roo.log(this.triggerEl.dom);
1021 if (Roo.get(e.getTarget()).findParent('.dropdown-menu')) {
1024 var isActive = this.triggerEl.hasClass('open');
1025 // if disabled.. ingore
1027 //if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
1028 // if mobile we use a backdrop because click events don't delegate
1029 // $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
1032 //var relatedTarget = { relatedTarget: this }
1033 //$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
1035 //if (e.isDefaultPrevented()) return;
1037 this.triggerEl[isActive ? 'removeClass' : 'addClass']('open');
1039 // .trigger('shown.bs.dropdown', relatedTarget)
1041 this.triggerEl.focus();
1047 clearMenus : function()
1049 //$(backdrop).remove()
1050 Roo.select('.dropdown-toggle',true).each(function(aa) {
1051 if (!aa.hasClass('open')) {
1055 aa.removeClass('open');
1056 //var parent = getParent($(this))
1057 //var relatedTarget = { relatedTarget: this }
1059 //$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
1060 //if (e.isDefaultPrevented()) return
1061 //$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
1079 * @class Roo.bootstrap.MenuItem
1080 * @extends Roo.bootstrap.Component
1081 * Bootstrap MenuItem class
1082 * @cfg {String} html the menu label
1083 * @cfg {String} href the link
1087 * Create a new MenuItem
1088 * @param {Object} config The config object
1092 Roo.bootstrap.MenuItem = function(config){
1093 Roo.bootstrap.MenuItem.superclass.constructor.call(this, config);
1096 Roo.extend(Roo.bootstrap.MenuItem, Roo.bootstrap.Component, {
1101 getAutoCreate : function(){
1113 cfg.cn[0].href = this.href || cfg.cn[0].href ;
1114 cfg.cn[0].html = this.html || cfg.cn[0].html ;
1131 * @class Roo.bootstrap.MenuSeparator
1132 * @extends Roo.bootstrap.Component
1133 * Bootstrap MenuSeparator class
1136 * Create a new MenuItem
1137 * @param {Object} config The config object
1141 Roo.bootstrap.MenuSeparator = function(config){
1142 Roo.bootstrap.MenuSeparator.superclass.constructor.call(this, config);
1145 Roo.extend(Roo.bootstrap.MenuSeparator, Roo.bootstrap.Component, {
1147 getAutoCreate : function(){
1162 <div class="modal fade">
1163 <div class="modal-dialog">
1164 <div class="modal-content">
1165 <div class="modal-header">
1166 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
1167 <h4 class="modal-title">Modal title</h4>
1169 <div class="modal-body">
1170 <p>One fine body…</p>
1172 <div class="modal-footer">
1173 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1174 <button type="button" class="btn btn-primary">Save changes</button>
1176 </div><!-- /.modal-content -->
1177 </div><!-- /.modal-dialog -->
1178 </div><!-- /.modal -->
1188 * @class Roo.bootstrap.Modal
1189 * @extends Roo.bootstrap.Component
1190 * Bootstrap Modal class
1191 * @cfg {String} title Title of dialog
1192 * @cfg {Array} buttons Array of buttons
1195 * Create a new Modal Dialog
1196 * @param {Object} config The config object
1199 Roo.bootstrap.Modal = function(config){
1200 Roo.bootstrap.Modal.superclass.constructor.call(this, config);
1203 Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, {
1205 title : 'test dialog',
1208 onRender : function(ct, position){
1209 Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
1211 var cfg = Roo.apply({}, this.getAutoCreate());
1214 // cfg.name = typeof(this.name) == 'undefined' ? this.id : this.name;
1216 //if (!cfg.name.length) {
1220 cfg.cls += ' ' + this.cls;
1223 cfg.style = this.style;
1225 this.el = Roo.get(document.body).createChild(cfg, position);
1227 //var type = this.el.dom.type;
1229 if(this.tabIndex !== undefined){
1230 this.el.dom.setAttribute('tabIndex', this.tabIndex);
1233 //this.el.addClass([this.fieldClass, this.cls]);
1236 getAutoCreate : function(){
1242 cls: "modal-dialog",
1245 cls : "modal-content",
1248 cls : 'modal-header',
1257 cls : 'modal-title',
1268 cls : 'modal-footer'
1273 cls : 'btn btn-default',
1278 cls : 'btn btn-primary',
1299 getChildContainer : function() {
1301 return this.el.select('.modal-body',true).first();
1304 getButtonContainer : function() {
1305 return this.el.select('.modal-footer',true).first();
1308 initEvents : function()
1310 this.el.select('.modal-header .close').on('click', this.hide, this);
1313 this.el.addClass('on');
1314 this.el.removeClass('fade');
1315 this.el.setStyle('display', 'block');
1318 this.el.removeClass('on');
1319 this.el.addClass('fade');
1320 this.el.setStyle('display', 'none');
1332 * @class Roo.bootstrap.Navbar
1333 * @extends Roo.bootstrap.Component
1334 * Bootstrap Navbar class
1335 * @cfg {Boolean} sidebar has side bar
1336 * @cfg {Boolean} bar is a bar?
1337 * @cfg {String} position (fixed-top|fixed-bottom|static-top) position
1338 * @cfg {String} brand what is brand
1339 * @cfg {Boolean} inverse is inverted color
1340 * @cfg {String} type (nav | pills | tabs)
1341 * @cfg {Boolean} arrangement stacked | justified
1342 * @cfg {String} align (left | right) alignment
1346 * Create a new Navbar
1347 * @param {Object} config The config object
1351 Roo.bootstrap.Navbar = function(config){
1352 Roo.bootstrap.Navbar.superclass.constructor.call(this, config);
1355 Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, {
1367 getAutoCreate : function(){
1372 if (this.sidebar === true) {
1380 if (this.bar === true) {
1388 cls: 'navbar-header',
1393 cls: 'navbar-toggle',
1394 'data-toggle': 'collapse',
1399 html: 'Toggle navigation'
1419 cls: 'collapse navbar-collapse'
1424 cfg.cls += this.inverse ? ' navbar-inverse' : ' navbar-default';
1426 if (['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1) {
1427 cfg.cls += ' navbar-' + this.position;
1428 cfg.tag = this.position == 'fixed-bottom' ? 'footer' : 'header';
1431 if (this.brand !== '') {
1435 cls: 'navbar-brand',
1444 } else if (this.bar === false) {
1447 Roo.log('Property \'bar\' in of Navbar must be either true or false')
1457 if (['tabs','pills'].indexOf(this.type)!==-1) {
1458 cfg.cn[0].cls += ' nav-' + this.type
1460 if (this.type!=='nav') {
1461 Roo.log('nav type must be nav/tabs/pills')
1463 cfg.cn[0].cls += ' navbar-nav'
1466 if (['stacked','justified'].indexOf(this.arrangement)!==-1) {
1467 cfg.cn[0].cls += ' nav-' + this.arrangement;
1470 if (this.align === 'right') {
1471 cfg.cn[0].cls += ' navbar-right';
1474 cfg.cls += ' navbar-inverse';
1482 getChildContainer : function() {
1483 if (this.bar === true) {
1484 return this.el.select('.collapse',true).first();
1502 * @class Roo.bootstrap.NavGroup
1503 * @extends Roo.bootstrap.Component
1504 * Bootstrap NavGroup class
1505 * @cfg {String} align left | right
1506 * @cfg {Boolean} inverse false | true
1509 * Create a new nav group
1510 * @param {Object} config The config object
1513 Roo.bootstrap.NavGroup = function(config){
1514 Roo.bootstrap.NavGroup.superclass.constructor.call(this, config);
1517 Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component, {
1523 getAutoCreate : function(){
1524 var cfg = Roo.apply({}, Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));
1528 cls: 'nav navbar-nav'
1531 if (this.parent().sidebar === true) {
1534 cls: 'dashboard-menu'
1540 if (this.form === true) {
1546 if (this.align === 'right') {
1547 cfg.cls += ' navbar-right';
1549 cfg.cls += ' navbar-left';
1554 if (this.align === 'right') {
1555 cfg.cls += ' navbar-right';
1559 cfg.cls += ' navbar-inverse';
1578 * @class Roo.bootstrap.Navbar.Button
1579 * @extends Roo.bootstrap.Component
1580 * Bootstrap Navbar.Button class
1581 * @cfg {String} href link to
1582 * @cfg {String} html content of button
1585 * Create a new Navbar Button
1586 * @param {Object} config The config object
1590 Roo.bootstrap.Navbar.Button = function(config){
1591 Roo.bootstrap.Navbar.Button.superclass.constructor.call(this, config);
1594 Roo.extend(Roo.bootstrap.Navbar.Button, Roo.bootstrap.Component, {
1605 getAutoCreate : function(){
1615 html : this.html || ''
1639 * @class Roo.bootstrap.Navbar.Item
1640 * @extends Roo.bootstrap.Component
1641 * Bootstrap Navbar.Button class
1642 * @cfg {String} href link to
1643 * @cfg {String} html content of button
1644 * @cfg {String} badge text inside badge
1645 * @cfg {String} glyphicon name of glyphicon
1648 * Create a new Navbar Button
1649 * @param {Object} config The config object
1651 Roo.bootstrap.Navbar.Item = function(config){
1652 Roo.bootstrap.Navbar.Item.superclass.constructor.call(this, config);
1655 Roo.extend(Roo.bootstrap.Navbar.Item, Roo.bootstrap.Component, {
1663 getAutoCreate : function(){
1665 var cfg = Roo.apply({}, Roo.bootstrap.Navbar.Item.superclass.getAutoCreate.call(this));
1667 if (this.parent().parent().sidebar === true) {
1680 cfg.cn[0].html = this.html;
1684 this.cls += ' active';
1688 cfg.cn[0].cls += ' dropdown-toggle';
1689 cfg.cn[0].html = (cfg.cn[0].html || this.html) + '<span class="glyphicon glyphicon-chevron-down"></span>';
1693 cfg.cn[0].tag = 'a',
1694 cfg.cn[0].href = this.href;
1697 if (this.glyphicon) {
1698 cfg.cn[0].html = '<i class="glyphicon glyphicon-'+this.glyphicon+'"></i><span>' + cfg.cn[0].html || this.html + '</span>'
1714 if (this.glyphicon) {
1715 if(cfg.html){cfg.html = ' ' + this.html};
1719 cls: 'glyphicon glyphicon-' + this.glyphicon
1724 cfg.cn[0].html = this.html || cfg.cn[0].html ;
1728 cfg.cn[0].html += " <span class='caret'></span>";
1729 //}else if (!this.href) {
1730 // cfg.cn[0].tag='p';
1731 // cfg.cn[0].cls='navbar-text';
1734 cfg.cn[0].href=this.href||'#';
1735 cfg.cn[0].html=this.html;
1738 if (this.badge !== '') {
1741 cfg.cn[0].html + ' ',
1754 initEvents: function() {
1755 // Roo.log('init events?');
1756 // Roo.log(this.el.dom);
1757 this.el.select('a',true).on('click',
1759 this.fireEvent('click', this);
1776 * @class Roo.bootstrap.Row
1777 * @extends Roo.bootstrap.Component
1778 * Bootstrap Row class (contains columns...)
1782 * @param {Object} config The config object
1785 Roo.bootstrap.Row = function(config){
1786 Roo.bootstrap.Row.superclass.constructor.call(this, config);
1789 Roo.extend(Roo.bootstrap.Row, Roo.bootstrap.Component, {
1808 * @class Roo.bootstrap.Element
1809 * @extends Roo.bootstrap.Component
1810 * Bootstrap Element class
1811 * @cfg {String} html contents of the element
1812 * @cfg {String} tag tag of the element
1813 * @cfg {String} cls class of the element
1816 * Create a new Element
1817 * @param {Object} config The config object
1820 Roo.bootstrap.Element = function(config){
1821 Roo.bootstrap.Element.superclass.constructor.call(this, config);
1824 Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component, {
1832 getAutoCreate : function(){
1833 var cfg = Roo.apply({}, Roo.bootstrap.Element.superclass.getAutoCreate.call(this));
1856 * @class Roo.bootstrap.Pagination
1857 * @extends Roo.bootstrap.Component
1858 * Bootstrap Pagination class
1859 * @cfg {String} size xs | sm | md | lg
1860 * @cfg {Boolean} inverse false | true
1861 * @cfg {Number} from pagination starting number
1862 * @cfg {Number} to pagination ending number
1863 * @cfg {String} align empty or left | right
1864 * @cfg {Number} active active page number
1867 * Create a new Pagination
1868 * @param {Object} config The config object
1871 Roo.bootstrap.Pagination = function(config){
1872 Roo.bootstrap.Pagination.superclass.constructor.call(this, config);
1875 Roo.extend(Roo.bootstrap.Pagination, Roo.bootstrap.Component, {
1885 getAutoCreate : function(){
1892 cfg.cls += ' inverse';
1910 var from=this.from>0?this.from:1;
1911 var to=this.to-from<=10?this.to:from+10;
1912 var active=this.active>=from&&this.active<=to?this.active:null;
1913 for (var i=from;i<=to;i++) {
1917 cls: active===i?'active':'',
1958 * @class Roo.bootstrap.Slider
1959 * @extends Roo.bootstrap.Component
1960 * Bootstrap Slider class
1963 * Create a new Slider
1964 * @param {Object} config The config object
1967 Roo.bootstrap.Slider = function(config){
1968 Roo.bootstrap.Slider.superclass.constructor.call(this, config);
1971 Roo.extend(Roo.bootstrap.Slider, Roo.bootstrap.Component, {
1973 getAutoCreate : function(){
1977 cls: 'slider slider-sample1 vertical-handler ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all',
1981 cls: 'ui-slider-handle ui-state-default ui-corner-all'
1999 * @class Roo.bootstrap.Table
2000 * @extends Roo.bootstrap.Component
2001 * Bootstrap Table class
2004 * Create a new Table
2005 * @param {Object} config The config object
2008 Roo.bootstrap.Table = function(config){
2009 Roo.bootstrap.Table.superclass.constructor.call(this, config);
2012 Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, {
2017 getAutoCreate : function(){
2018 var cfg = Roo.apply({}, Roo.bootstrap.Table.superclass.getAutoCreate.call(this));
2050 * @class Roo.bootstrap.TableCell
2051 * @extends Roo.bootstrap.Component
2052 * Bootstrap TableCell class
2055 * Create a new TableCell
2056 * @param {Object} config The config object
2059 Roo.bootstrap.TableCell = function(config){
2060 Roo.bootstrap.TableCell.superclass.constructor.call(this, config);
2063 Roo.extend(Roo.bootstrap.TableCell, Roo.bootstrap.Component, {
2065 getAutoCreate : function(){
2066 var cfg = Roo.apply({}, Roo.bootstrap.TableCell.superclass.getAutoCreate.call(this));
2093 * @class Roo.bootstrap.TableRow
2094 * @extends Roo.bootstrap.Component
2095 * Bootstrap TableRow class
2098 * Create a new TableRow
2099 * @param {Object} config The config object
2102 Roo.bootstrap.TableRow = function(config){
2103 Roo.bootstrap.TableRow.superclass.constructor.call(this, config);
2106 Roo.extend(Roo.bootstrap.TableRow, Roo.bootstrap.Component, {
2108 getAutoCreate : function(){
2109 var cfg = Roo.apply({}, Roo.bootstrap.TableRow.superclass.getAutoCreate.call(this));