diff --git a/dist/fix/fix.compact.ie.js b/dist/fix/fix.compact.ie.js index 152f94f89..ab949b5bd 100644 --- a/dist/fix/fix.compact.ie.js +++ b/dist/fix/fix.compact.ie.js @@ -93,15 +93,15 @@ } } - _.each(["populate", "addItems", "prependItems"], function (name) { - var old = BI.Loader.prototype[name]; - BI.Loader.prototype[name] = function () { - BI.Widget.pushContext(this); - var result = old.apply(this, arguments); - BI.Widget.popContext(); - return result; - }; - }); + // _.each(["populate", "addItems", "prependItems"], function (name) { + // var old = BI.Loader.prototype[name]; + // BI.Loader.prototype[name] = function () { + // BI.Widget.pushContext(this); + // var result = old.apply(this, arguments); + // BI.Widget.popContext(); + // return result; + // }; + // }); function createStore () { var needPop = false; diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js index 1fa5e2972..8b635c0c1 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -97,19 +97,19 @@ } } - _.each(["populate", "addItems", "prependItems"], function (name) { - var old = BI.Loader.prototype[name]; - BI.Loader.prototype[name] = function () { - BI.Widget.pushContext(this); - try { - var result = old.apply(this, arguments); - } catch (e) { - console.error(e); - } - BI.Widget.popContext(); - return result; - }; - }); + // _.each(["populate", "addItems", "prependItems"], function (name) { + // var old = BI.Loader.prototype[name]; + // BI.Loader.prototype[name] = function () { + // BI.Widget.pushContext(this); + // try { + // var result = old.apply(this, arguments); + // } catch (e) { + // console.error(e); + // } + // BI.Widget.popContext(); + // return result; + // }; + // }); function createStore () { var needPop = false; diff --git a/examples/loader-context.html b/examples/loader-context.html new file mode 100644 index 000000000..72695cc9f --- /dev/null +++ b/examples/loader-context.html @@ -0,0 +1,124 @@ + + + + + + + + +
+ + + diff --git a/examples/tab-context.html b/examples/tab-context.html index 33edfd13c..9e7cf33ea 100644 --- a/examples/tab-context.html +++ b/examples/tab-context.html @@ -39,13 +39,20 @@ var Child = BI.inherit(BI.Widget, { setup: function () { + var label var store = BI.useStore(function () { return BI.Models.getModel("demo.child_model"); }); + BI.watch("text", function (text) { + label.setText(text) + }); return { render: function () { return { type: "bi.label", + ref: function (_ref) { + label = _ref; + }, text: store.model.text }; } diff --git a/src/base/combination/group.button.js b/src/base/combination/group.button.js index 3a13f6d6e..d9642d696 100644 --- a/src/base/combination/group.button.js +++ b/src/base/combination/group.button.js @@ -40,7 +40,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { var o = this.options; return BI.createWidgets(BI.createItems(items, { type: "bi.text_button" - })); + }), this); }, _btnsCreator: function (items) { diff --git a/src/core/2.base.js b/src/core/2.base.js index c9e7b1699..3aa8a155b 100644 --- a/src/core/2.base.js +++ b/src/core/2.base.js @@ -84,7 +84,7 @@ if (!_global.BI) { options || (options = {}); } return BI.map(BI.flatten(items), function (i, item) { - return BI.createWidget(item, BI.deepClone(options)); + return BI.createWidget(item, BI.deepClone(options), context); }); },