pressed : null,
-
+
getAutoCreate : function(){
}
cfg.html = this.html || cfg.html;
- if (this.toggle === true) {
+ if (this.toggle == true) {
cfg={
tag: 'div',
cls: 'slider-frame roo-button',
this.el.select('.roo-button').on('click', this.onClick, this);
}
-
+ this.el.enableDisplayMode();
},
onClick : function(e)
{
+ if (this.disabled) {
+ return;
+ }
+
Roo.log('button on click ');
if(this.preventDefault){
e.preventDefault();
this.fireEvent('click', this, e);
+ },
+
+ /**
+ * 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');
+ },
+ /**
+ * toggles the current active state
+ */
+ toggleActive : function()
+ {
+ var active = this.el.hasClass('active');
+ this.setActive(!active);
+
+
+ },
+ setText : function(str)
+ {
+ this.el.select('.roo-button-text',true).first().dom.innerHTML = str;
+ },
+ hide: function() {
+
+
+ this.el.hide();
+ },
+ show: function() {
+
+ this.el.show();
}