diff --git a/demo/js/main.js b/demo/js/main.js index 293507c354..a3d121f34c 100644 --- a/demo/js/main.js +++ b/demo/js/main.js @@ -13,8 +13,8 @@ Demo.Main = BI.inherit(BI.Widget, { type: "demo.north", listeners: [{ eventName: Demo.North.EVENT_VALUE_CHANGE, - action: function () { - center.setValue(0); + action: function (v) { + center.setValue(v); } }] } diff --git a/demo/js/north.js b/demo/js/north.js index 89b07f7d8d..45e89cac69 100644 --- a/demo/js/north.js +++ b/demo/js/north.js @@ -13,7 +13,7 @@ Demo.North = BI.inherit(BI.Widget, { listeners: [{ eventName: BI.Button.EVENT_CHANGE, action: function () { - self.fireEvent(Demo.North.EVENT_VALUE_CHANGE, 0) + self.fireEvent(Demo.North.EVENT_VALUE_CHANGE, "demo.face") } }], cls: "logo", diff --git a/dist/core.js b/dist/core.js index 38a32f6579..b997ee29f5 100644 --- a/dist/core.js +++ b/dist/core.js @@ -14244,11 +14244,15 @@ BI.Widget = BI.inherit(BI.OB, { if (o.invisible) { this.element.hide(); } - if (o.disabled) { - this.element.addClass("base-disabled disabled"); - } - if (o.invalid) { - this.element.addClass("base-invalid invalid"); + if (o.disabled || o.invalid) { + BI.nextTick(BI.bind(function () { + if (this.options.disabled) { + this.setEnable(false); + } + if (this.options.invalid) { + this.setValid(false); + } + }, this)); } }, diff --git a/src/core/widget.js b/src/core/widget.js index 1326dee575..541c986998 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -106,11 +106,15 @@ BI.Widget = BI.inherit(BI.OB, { if (o.invisible) { this.element.hide(); } - if (o.disabled) { - this.element.addClass("base-disabled disabled"); - } - if (o.invalid) { - this.element.addClass("base-invalid invalid"); + if (o.disabled || o.invalid) { + BI.nextTick(BI.bind(function () { + if (this.options.disabled) { + this.setEnable(false); + } + if (this.options.invalid) { + this.setValid(false); + } + }, this)); } },