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
479 * Create a new Column
480 * @param {Object} config The config object
483 Roo.bootstrap.Column = function(config){
484 Roo.bootstrap.Column.superclass.constructor.call(this, config);
487 Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component, {
496 getAutoCreate : function(){
497 var cfg = Roo.apply({}, Roo.bootstrap.Column.superclass.getAutoCreate.call(this));
505 ['xs','sm','md','lg'].map(function(size){
506 if (settings[size]) {
507 cfg.cls += ' col-' + size + '-' + settings[size];
527 * @class Roo.bootstrap.Container
528 * @extends Roo.bootstrap.Component
529 * Bootstrap Container class
530 * @cfg {Boolean} jumbotron is it a jumbotron element
531 * @cfg {String} html content of element
532 * @cfg {Boolean} well container is a well
535 * Create a new Container
536 * @param {Object} config The config object
539 Roo.bootstrap.Container = function(config){
540 Roo.bootstrap.Container.superclass.constructor.call(this, config);
543 Roo.extend(Roo.bootstrap.Container, Roo.bootstrap.Component, {
548 getAutoCreate : function(){
554 if (this.jumbotron) {
555 cfg.cls = 'jumbotron';
561 cfg.html = this.html || cfg.html;
575 * @class Roo.bootstrap.Form
576 * @extends Roo.bootstrap.Component
577 * Bootstrap Form class
578 * @cfg {String} method GET | POST (default POST)
579 * @cfg {String} labelAlign top | left (default top)
583 * @param {Object} config The config object
587 Roo.bootstrap.Form = function(config){
588 Roo.bootstrap.Form.superclass.constructor.call(this, config);
591 * @event clientvalidation
592 * If the monitorValid config option is true, this event fires repetitively to notify of valid state
594 * @param {Boolean} valid true if the form has passed client-side validation
596 clientvalidation: true,
599 * Fires when the form is rendered
600 * @param {Roo.form.Form} form
606 Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component, {
609 getAutoCreate : function(){
613 method : this.method || 'POST',
614 id : this.id || Roo.id(),
618 if (this.labelAlign == 'left' ) {
619 cfg.cls += ' form-horizontal';
636 * @class Roo.bootstrap.Img
637 * @extends Roo.bootstrap.Component
638 * Bootstrap Img class
639 * @cfg {Boolean} imgResponsive false | true
640 * @cfg {String} border rounded | circle | thumbnail
641 * @cfg {String} src image source
642 * @cfg {String} alt image alternative text
646 * @param {Object} config The config object
649 Roo.bootstrap.Img = function(config){
650 Roo.bootstrap.Img.superclass.constructor.call(this, config);
653 Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, {
659 getAutoCreate : function(){
663 cls: 'img-responsive',
667 cfg.html = this.html || cfg.html;
669 cfg.src = this.src || cfg.src;
671 if (['rounded','circle','thumbnail'].indexOf(this.border)>-1) {
672 cfg.cls += ' img-' + this.border;
692 * @class Roo.bootstrap.Input
693 * @extends Roo.bootstrap.Component
694 * Bootstrap Input class
695 * @cfg {Boolean} disabled is it disabled
696 * @cfg {String} fieldLabel - the label associated
697 * @cfg {String} inputType button | checkbox | email | file | hidden | image | number | password | radio | range | reset | search | submit | text
698 * @cfg {String} name name of the input
699 * @cfg {boolean} disabled is it disabled
700 * @cfg {string} fieldLabel - the label associated
701 * @cfg {string} inputType - input / file submit ...
702 * @cfg {string} placeholder - placeholder to put in text.
703 * @cfg {string} before - input group add on before
704 * @cfg {string} after - input group add on after
709 * @param {Object} config The config object
712 Roo.bootstrap.Input = function(config){
713 Roo.bootstrap.Input.superclass.constructor.call(this, config);
717 Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component, {
727 getAutoCreate : function(){
729 var parent = this.parent();
731 var align = parent.labelAlign;
736 cls: 'form-group' //input-group
742 type : this.inputType,
743 cls : 'form-control',
744 placeholder : this.placeholder || ''
751 var inputblock = input;
753 if (this.before || this.after) {
762 cls : 'input-group-addon',
766 inputblock.cn.push(input);
770 cls : 'input-group-addon',
778 Roo.log(this.fieldLabel.length);
780 if (align ==='left' && this.fieldLabel.length) {
781 Roo.log("left and has label");
787 cls : 'col-sm-2 control-label',
788 html : this.fieldLabel
799 } else if ( this.fieldLabel.length) {
805 //cls : 'input-group-addon',
806 html : this.fieldLabel
816 Roo.log(" no label && no align");
835 setDisabled : function(v)
837 var i = this.el.select('input',true).dom;
839 i.removeAttribute('disabled');
843 i.setAttribute('disabled','true');
856 * @class Roo.bootstrap.Header
857 * @extends Roo.bootstrap.Component
858 * Bootstrap Header class
859 * @cfg {String} html content of header
860 * @cfg {Number} level (1|2|3|4|5|6) default 1
863 * Create a new Header
864 * @param {Object} config The config object
868 Roo.bootstrap.Header = function(config){
869 Roo.bootstrap.Header.superclass.constructor.call(this, config);
872 Roo.extend(Roo.bootstrap.Header, Roo.bootstrap.Component, {
880 getAutoCreate : function(){
883 tag: 'h' + (1 *this.level),
884 html: this.html || 'fill in html'
902 * @class Roo.bootstrap.Menu
903 * @extends Roo.bootstrap.Component
904 * Bootstrap Menu class - container for MenuItems
905 * @cfg {String} type type of menu
909 * @param {Object} config The config object
913 Roo.bootstrap.Menu = function(config){
914 Roo.bootstrap.Menu.superclass.constructor.call(this, config);
917 Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component, {
925 getChildContainer : function() {
929 getAutoCreate : function(){
931 //if (['right'].indexOf(this.align)!==-1) {
932 // cfg.cn[1].cls += ' pull-right'
936 cls : 'dropdown-menu'
940 if (this.type==='submenu') {
941 cfg.cls='submenu active'
946 initEvents : function() {
947 // Roo.log("ADD event");
948 // Roo.log(this.triggerEl.dom);
949 this.triggerEl.on('click', this.toggle, this);
950 this.triggerEl.addClass('dropdown-toggle');
955 //Roo.log(e.getTarget());
956 // Roo.log(this.triggerEl.dom);
957 if (Roo.get(e.getTarget()).findParent('.dropdown-menu')) {
960 var isActive = this.triggerEl.hasClass('open');
961 // if disabled.. ingore
963 //if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
964 // if mobile we use a backdrop because click events don't delegate
965 // $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
968 //var relatedTarget = { relatedTarget: this }
969 //$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
971 //if (e.isDefaultPrevented()) return;
973 this.triggerEl[isActive ? 'removeClass' : 'addClass']('open');
975 // .trigger('shown.bs.dropdown', relatedTarget)
977 this.triggerEl.focus();
983 clearMenus : function()
985 //$(backdrop).remove()
986 Roo.select('.dropdown-toggle',true).each(function(aa) {
987 if (!aa.hasClass('open')) {
991 aa.removeClass('open');
992 //var parent = getParent($(this))
993 //var relatedTarget = { relatedTarget: this }
995 //$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
996 //if (e.isDefaultPrevented()) return
997 //$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
1015 * @class Roo.bootstrap.MenuItem
1016 * @extends Roo.bootstrap.Component
1017 * Bootstrap MenuItem class
1018 * @cfg {String} html the menu label
1019 * @cfg {String} href the link
1023 * Create a new MenuItem
1024 * @param {Object} config The config object
1028 Roo.bootstrap.MenuItem = function(config){
1029 Roo.bootstrap.MenuItem.superclass.constructor.call(this, config);
1032 Roo.extend(Roo.bootstrap.MenuItem, Roo.bootstrap.Component, {
1037 getAutoCreate : function(){
1049 cfg.cn[0].href = this.href || cfg.cn[0].href ;
1050 cfg.cn[0].html = this.html || cfg.cn[0].html ;
1067 * @class Roo.bootstrap.MenuSeparator
1068 * @extends Roo.bootstrap.Component
1069 * Bootstrap MenuSeparator class
1072 * Create a new MenuItem
1073 * @param {Object} config The config object
1077 Roo.bootstrap.MenuSeparator = function(config){
1078 Roo.bootstrap.MenuSeparator.superclass.constructor.call(this, config);
1081 Roo.extend(Roo.bootstrap.MenuSeparator, Roo.bootstrap.Component, {
1083 getAutoCreate : function(){
1098 <div class="modal fade">
1099 <div class="modal-dialog">
1100 <div class="modal-content">
1101 <div class="modal-header">
1102 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
1103 <h4 class="modal-title">Modal title</h4>
1105 <div class="modal-body">
1106 <p>One fine body…</p>
1108 <div class="modal-footer">
1109 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1110 <button type="button" class="btn btn-primary">Save changes</button>
1112 </div><!-- /.modal-content -->
1113 </div><!-- /.modal-dialog -->
1114 </div><!-- /.modal -->
1124 * @class Roo.bootstrap.Modal
1125 * @extends Roo.bootstrap.Component
1126 * Bootstrap Modal class
1127 * @cfg {String} title Title of dialog
1128 * @cfg {Array} buttons Array of buttons
1131 * Create a new Modal Dialog
1132 * @param {Object} config The config object
1135 Roo.bootstrap.Modal = function(config){
1136 Roo.bootstrap.Modal.superclass.constructor.call(this, config);
1139 Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, {
1141 title : 'test dialog',
1144 onRender : function(ct, position){
1145 Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
1147 var cfg = Roo.apply({}, this.getAutoCreate());
1150 // cfg.name = typeof(this.name) == 'undefined' ? this.id : this.name;
1152 //if (!cfg.name.length) {
1156 cfg.cls += ' ' + this.cls;
1159 cfg.style = this.style;
1161 this.el = Roo.get(document.body).createChild(cfg, position);
1163 //var type = this.el.dom.type;
1165 if(this.tabIndex !== undefined){
1166 this.el.dom.setAttribute('tabIndex', this.tabIndex);
1169 //this.el.addClass([this.fieldClass, this.cls]);
1172 getAutoCreate : function(){
1178 cls: "modal-dialog",
1181 cls : "modal-content",
1184 cls : 'modal-header',
1193 cls : 'modal-title',
1204 cls : 'modal-footer'
1209 cls : 'btn btn-default',
1214 cls : 'btn btn-primary',
1235 getChildContainer : function() {
1237 return this.el.select('.modal-body',true).first();
1240 getButtonContainer : function() {
1241 return this.el.select('.modal-footer',true).first();
1244 initEvents : function()
1246 this.el.select('.modal-header .close').on('click', this.hide, this);
1249 this.el.addClass('on');
1250 this.el.removeClass('fade');
1251 this.el.setStyle('display', 'block');
1254 this.el.removeClass('on');
1255 this.el.addClass('fade');
1256 this.el.setStyle('display', 'none');
1268 * @class Roo.bootstrap.Navbar
1269 * @extends Roo.bootstrap.Component
1270 * Bootstrap Navbar class
1271 * @cfg {Boolean} sidebar has side bar
1272 * @cfg {Boolean} bar is a bar?
1273 * @cfg {String} position (fixed-top|fixed-bottom|static-top) position
1274 * @cfg {String} brand what is brand
1275 * @cfg {Boolean} inverse is inverted color
1276 * @cfg {String} type (nav | pills | tabs)
1277 * @cfg {Boolean} arrangement stacked | justified
1278 * @cfg {String} align (left | right) alignment
1282 * Create a new Navbar
1283 * @param {Object} config The config object
1287 Roo.bootstrap.Navbar = function(config){
1288 Roo.bootstrap.Navbar.superclass.constructor.call(this, config);
1291 Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, {
1303 getAutoCreate : function(){
1308 if (this.sidebar === true) {
1316 if (this.bar === true) {
1324 cls: 'navbar-header',
1329 cls: 'navbar-toggle',
1330 'data-toggle': 'collapse',
1335 html: 'Toggle navigation'
1355 cls: 'collapse navbar-collapse'
1360 cfg.cls += this.inverse ? ' navbar-inverse' : ' navbar-default';
1362 if (['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1) {
1363 cfg.cls += ' navbar-' + this.position;
1364 cfg.tag = this.position == 'fixed-bottom' ? 'footer' : 'header';
1367 if (this.brand !== '') {
1371 cls: 'navbar-brand',
1380 } else if (this.bar === false) {
1383 Roo.log('Property \'bar\' in of Navbar must be either true or false')
1393 if (['tabs','pills'].indexOf(this.type)!==-1) {
1394 cfg.cn[0].cls += ' nav-' + this.type
1396 if (this.type!=='nav') {
1397 Roo.log('nav type must be nav/tabs/pills')
1399 cfg.cn[0].cls += ' navbar-nav'
1402 if (['stacked','justified'].indexOf(this.arrangement)!==-1) {
1403 cfg.cn[0].cls += ' nav-' + this.arrangement;
1406 if (this.align === 'right') {
1407 cfg.cn[0].cls += ' navbar-right';
1410 cfg.cls += ' navbar-inverse';
1418 getChildContainer : function() {
1419 if (this.bar === true) {
1420 return this.el.select('.collapse',true).first();
1438 * @class Roo.bootstrap.NavGroup
1439 * @extends Roo.bootstrap.Component
1440 * Bootstrap NavGroup class
1441 * @cfg {String} align left | right
1442 * @cfg {Boolean} inverse false | true
1445 * Create a new nav group
1446 * @param {Object} config The config object
1449 Roo.bootstrap.NavGroup = function(config){
1450 Roo.bootstrap.NavGroup.superclass.constructor.call(this, config);
1453 Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component, {
1459 getAutoCreate : function(){
1460 var cfg = Roo.apply({}, Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));
1464 cls: 'nav navbar-nav'
1467 if (this.parent().sidebar === true) {
1470 cls: 'dashboard-menu'
1476 if (this.form === true) {
1482 if (this.align === 'right') {
1483 cfg.cls += ' navbar-right';
1485 cfg.cls += ' navbar-left';
1490 if (this.align === 'right') {
1491 cfg.cls += ' navbar-right';
1495 cfg.cls += ' navbar-inverse';
1514 * @class Roo.bootstrap.Navbar.Button
1515 * @extends Roo.bootstrap.Component
1516 * Bootstrap Navbar.Button class
1517 * @cfg {String} href link to
1518 * @cfg {String} html content of button
1521 * Create a new Navbar Button
1522 * @param {Object} config The config object
1526 Roo.bootstrap.Navbar.Button = function(config){
1527 Roo.bootstrap.Navbar.Button.superclass.constructor.call(this, config);
1530 Roo.extend(Roo.bootstrap.Navbar.Button, Roo.bootstrap.Component, {
1541 getAutoCreate : function(){
1551 html : this.html || ''
1575 * @class Roo.bootstrap.Navbar.Item
1576 * @extends Roo.bootstrap.Component
1577 * Bootstrap Navbar.Button class
1578 * @cfg {String} href link to
1579 * @cfg {String} html content of button
1580 * @cfg {String} badge text inside badge
1581 * @cfg {String} glyphicon name of glyphicon
1584 * Create a new Navbar Button
1585 * @param {Object} config The config object
1587 Roo.bootstrap.Navbar.Item = function(config){
1588 Roo.bootstrap.Navbar.Item.superclass.constructor.call(this, config);
1591 Roo.extend(Roo.bootstrap.Navbar.Item, Roo.bootstrap.Component, {
1599 getAutoCreate : function(){
1601 var cfg = Roo.apply({}, Roo.bootstrap.Navbar.Item.superclass.getAutoCreate.call(this));
1603 if (this.parent().parent().sidebar === true) {
1616 cfg.cn[0].html = this.html;
1620 this.cls += ' active';
1624 cfg.cn[0].cls += ' dropdown-toggle';
1625 cfg.cn[0].html = (cfg.cn[0].html || this.html) + '<span class="glyphicon glyphicon-chevron-down"></span>';
1629 cfg.cn[0].tag = 'a',
1630 cfg.cn[0].href = this.href;
1633 if (this.glyphicon) {
1634 cfg.cn[0].html = '<i class="glyphicon glyphicon-'+this.glyphicon+'"></i><span>' + cfg.cn[0].html || this.html + '</span>'
1650 if (this.glyphicon) {
1651 if(cfg.html){cfg.html = ' ' + this.html};
1655 cls: 'glyphicon glyphicon-' + this.glyphicon
1660 cfg.cn[0].html = this.html || cfg.cn[0].html ;
1664 cfg.cn[0].html += " <span class='caret'></span>";
1665 //}else if (!this.href) {
1666 // cfg.cn[0].tag='p';
1667 // cfg.cn[0].cls='navbar-text';
1670 cfg.cn[0].href=this.href||'#';
1671 cfg.cn[0].html=this.html;
1674 if (this.badge !== '') {
1677 cfg.cn[0].html + ' ',
1690 initEvents: function() {
1691 // Roo.log('init events?');
1692 // Roo.log(this.el.dom);
1693 this.el.select('a',true).on('click',
1695 this.fireEvent('click', this);
1712 * @class Roo.bootstrap.Row
1713 * @extends Roo.bootstrap.Component
1714 * Bootstrap Row class (contains columns...)
1718 * @param {Object} config The config object
1721 Roo.bootstrap.Row = function(config){
1722 Roo.bootstrap.Row.superclass.constructor.call(this, config);
1725 Roo.extend(Roo.bootstrap.Row, Roo.bootstrap.Component, {
1744 * @class Roo.bootstrap.Element
1745 * @extends Roo.bootstrap.Component
1746 * Bootstrap Element class
1747 * @cfg {String} html contents of the element
1748 * @cfg {String} tag tag of the element
1749 * @cfg {String} cls class of the element
1752 * Create a new Element
1753 * @param {Object} config The config object
1756 Roo.bootstrap.Element = function(config){
1757 Roo.bootstrap.Element.superclass.constructor.call(this, config);
1760 Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component, {
1768 getAutoCreate : function(){
1769 var cfg = Roo.apply({}, Roo.bootstrap.Element.superclass.getAutoCreate.call(this));
1792 * @class Roo.bootstrap.Pagination
1793 * @extends Roo.bootstrap.Component
1794 * Bootstrap Pagination class
1795 * @cfg {String} size xs | sm | md | lg
1796 * @cfg {Boolean} inverse false | true
1797 * @cfg {Number} from pagination starting number
1798 * @cfg {Number} to pagination ending number
1799 * @cfg {String} align empty or left | right
1800 * @cfg {Number} active active page number
1803 * Create a new Pagination
1804 * @param {Object} config The config object
1807 Roo.bootstrap.Pagination = function(config){
1808 Roo.bootstrap.Pagination.superclass.constructor.call(this, config);
1811 Roo.extend(Roo.bootstrap.Pagination, Roo.bootstrap.Component, {
1821 getAutoCreate : function(){
1828 cfg.cls += ' inverse';
1846 var from=this.from>0?this.from:1;
1847 var to=this.to-from<=10?this.to:from+10;
1848 var active=this.active>=from&&this.active<=to?this.active:null;
1849 for (var i=from;i<=to;i++) {
1853 cls: active===i?'active':'',
1894 * @class Roo.bootstrap.Slider
1895 * @extends Roo.bootstrap.Component
1896 * Bootstrap Slider class
1899 * Create a new Slider
1900 * @param {Object} config The config object
1903 Roo.bootstrap.Slider = function(config){
1904 Roo.bootstrap.Slider.superclass.constructor.call(this, config);
1907 Roo.extend(Roo.bootstrap.Slider, Roo.bootstrap.Component, {
1909 getAutoCreate : function(){
1913 cls: 'slider slider-sample1 vertical-handler ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all',
1917 cls: 'ui-slider-handle ui-state-default ui-corner-all'
1935 * @class Roo.bootstrap.Table
1936 * @extends Roo.bootstrap.Component
1937 * Bootstrap Table class
1940 * Create a new Table
1941 * @param {Object} config The config object
1944 Roo.bootstrap.Table = function(config){
1945 Roo.bootstrap.Table.superclass.constructor.call(this, config);
1948 Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, {
1953 getAutoCreate : function(){
1954 var cfg = Roo.apply({}, Roo.bootstrap.Table.superclass.getAutoCreate.call(this));
1986 * @class Roo.bootstrap.TableCell
1987 * @extends Roo.bootstrap.Component
1988 * Bootstrap TableCell class
1991 * Create a new TableCell
1992 * @param {Object} config The config object
1995 Roo.bootstrap.TableCell = function(config){
1996 Roo.bootstrap.TableCell.superclass.constructor.call(this, config);
1999 Roo.extend(Roo.bootstrap.TableCell, Roo.bootstrap.Component, {
2001 getAutoCreate : function(){
2002 var cfg = Roo.apply({}, Roo.bootstrap.TableCell.superclass.getAutoCreate.call(this));
2029 * @class Roo.bootstrap.TableRow
2030 * @extends Roo.bootstrap.Component
2031 * Bootstrap TableRow class
2034 * Create a new TableRow
2035 * @param {Object} config The config object
2038 Roo.bootstrap.TableRow = function(config){
2039 Roo.bootstrap.TableRow.superclass.constructor.call(this, config);
2042 Roo.extend(Roo.bootstrap.TableRow, Roo.bootstrap.Component, {
2044 getAutoCreate : function(){
2045 var cfg = Roo.apply({}, Roo.bootstrap.TableRow.superclass.getAutoCreate.call(this));