diff --git a/demo/js/core/abstract/demo.virtual_group.js b/demo/js/core/abstract/demo.virtual_group.js index e07175f601..77e33d2160 100644 --- a/demo/js/core/abstract/demo.virtual_group.js +++ b/demo/js/core/abstract/demo.virtual_group.js @@ -66,14 +66,13 @@ Demo.Item = BI.inherit(BI.Widget, { update: function (item) { this.label.setText(item.value); console.log("更新了一项"); - return true; }, created: function () { console.log("创建了一项"); }, - destroyed: function(){ + destroyed: function () { console.log("删除了一项"); } }); diff --git a/dist/core.js b/dist/core.js index ee7845ebb6..8c5bc6811e 100644 --- a/dist/core.js +++ b/dist/core.js @@ -14342,9 +14342,7 @@ BI.Widget = BI.inherit(BI.OB, { }, - update: function () { - - }, + update: null, destroyed: function () { }, @@ -19482,9 +19480,10 @@ BI.Layout = BI.inherit(BI.Widget, { return; } - var updated; - if (updated = this._children[this._getChildName(index)].update(this._getOptions(item))) { - return updated; + var child = this._children[this._getChildName(index)]; + if (child.update) { + child.update(this._getOptions(item)); + return true; } this._children[this._getChildName(index)].destroy(); var w = this._addElement(index, item); diff --git a/src/core/widget.js b/src/core/widget.js index b5d1f56661..860e16d4d9 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -43,9 +43,7 @@ BI.Widget = BI.inherit(BI.OB, { }, - update: function () { - - }, + update: null, destroyed: function () { }, diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index 424a51e67a..4dc406e53f 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -224,9 +224,10 @@ BI.Layout = BI.inherit(BI.Widget, { return; } - var updated; - if (updated = this._children[this._getChildName(index)].update(this._getOptions(item))) { - return updated; + var child = this._children[this._getChildName(index)]; + if (child.update) { + child.update(this._getOptions(item)); + return true; } this._children[this._getChildName(index)].destroy(); var w = this._addElement(index, item);