+ },
+
+ /**
+ * Enables this button
+ */
+ enable : function()
+ {
+ this.disabled = false;
+ this.el.removeClass('disabled');
+ },
+
+ /**
+ * Disable this button
+ */
+ disable : function()
+ {
+ this.disabled = true;
+ this.el.addClass('disabled');
+ },
+ /**
+ * sets the active state on/off,
+ * @param {Boolean} state (optional) Force a particular state
+ */
+ setActive : function(v) {
+
+ this.el[v ? 'addClass' : 'removeClass']('active');
+ this.pressed = v;
+ },
+ /**
+ * toggles the current active state
+ */
+ toggleActive : function(e)
+ {
+ this.setActive(!this.pressed);
+ this.fireEvent('toggle', this, e, !this.pressed);
+ },
+ /**
+ * get the current active state
+ * @return {boolean} true if it's active
+ */
+ isActive : function()
+ {
+ return this.el.hasClass('active');
+ },
+ /**
+ * set the text of the first selected button
+ */
+ setText : function(str)
+ {
+ this.el.select('.roo-button-text',true).first().dom.innerHTML = str;
+ },
+ /**
+ * get the text of the first selected button
+ */
+ getText : function()
+ {
+ return this.el.select('.roo-button-text',true).first().dom.innerHTML;
+ },
+
+ setWeight : function(str)
+ {
+ this.el.removeClass(Roo.bootstrap.Button.weights.map(function(w) { return 'btn-' + w; } ) );
+ this.el.removeClass(Roo.bootstrap.Button.weights.map(function(w) { return 'btn-outline-' + w; } ) );
+ this.weight = str;
+ var outline = this.outline ? 'outline-' : '';
+ if (str == 'default') {
+ this.el.addClass('btn-default btn-outline-secondary');
+ return;
+ }
+ this.el.addClass('btn-' + outline + str);