diff --git a/demo/js/config/demo.pane.js b/demo/js/config/demo.pane.js index 017da481fb..30b2415a71 100644 --- a/demo/js/config/demo.pane.js +++ b/demo/js/config/demo.pane.js @@ -9,7 +9,7 @@ }, - loadedRender: function () { + render: function () { return { type: "bi.center_adapt", items: [{ @@ -19,7 +19,7 @@ }; }, - reqInitData: function (callback) { + beforeInit: function (callback) { setTimeout(function () { callback(); }, 3000); diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index 92d5257795..65bb071981 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -11771,6 +11771,10 @@ if (!_global.BI) { this._initElementHeight(); this._initVisual(); this._initState(); + this._initRender(); + }, + + _initRender: function () { if (this.beforeInit) { this.__asking = true; this.beforeInit(BI.bind(this._render, this)); @@ -57180,37 +57184,28 @@ BI.shortcut("bi.sort_list", BI.SortList); BI.LoadingPane = BI.inherit(BI.Pane, { _mount: function () { - BI.Pane.superclass._mount.apply(this, arguments); - if (this.isMounted()) { - this.loading(); - this.reqInitData(BI.bind(this.__loaded, this)); + var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } } }, - render: function () { - return { - type: "bi.default" - }; - }, - - /** - * 子类用loadedRender代替原先的render方法 - */ - loadedRender: function () { - return { - type: "bi.default" - }; - }, - - reqInitData: function (callback) { - BI.isFunction(callback) && callback(); + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } }, __loaded: function () { + this.__asking = false; this.loaded(); - BI.createWidget(this.loadedRender(), { - element: this - }, this); + this._render(); } });/** * 有总页数和总行数的分页控件 diff --git a/dist/bundle.js b/dist/bundle.js index 3313069e3a..dfad0129e3 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -11771,6 +11771,10 @@ if (!_global.BI) { this._initElementHeight(); this._initVisual(); this._initState(); + this._initRender(); + }, + + _initRender: function () { if (this.beforeInit) { this.__asking = true; this.beforeInit(BI.bind(this._render, this)); @@ -57584,37 +57588,28 @@ BI.shortcut("bi.sort_list", BI.SortList); BI.LoadingPane = BI.inherit(BI.Pane, { _mount: function () { - BI.Pane.superclass._mount.apply(this, arguments); - if (this.isMounted()) { - this.loading(); - this.reqInitData(BI.bind(this.__loaded, this)); + var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } } }, - render: function () { - return { - type: "bi.default" - }; - }, - - /** - * 子类用loadedRender代替原先的render方法 - */ - loadedRender: function () { - return { - type: "bi.default" - }; - }, - - reqInitData: function (callback) { - BI.isFunction(callback) && callback(); + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } }, __loaded: function () { + this.__asking = false; this.loaded(); - BI.createWidget(this.loadedRender(), { - element: this - }, this); + this._render(); } });/** * 有总页数和总行数的分页控件 diff --git a/dist/case.js b/dist/case.js index 20f9a660fc..fd314080ea 100644 --- a/dist/case.js +++ b/dist/case.js @@ -7982,37 +7982,28 @@ BI.shortcut("bi.sort_list", BI.SortList); BI.LoadingPane = BI.inherit(BI.Pane, { _mount: function () { - BI.Pane.superclass._mount.apply(this, arguments); - if (this.isMounted()) { - this.loading(); - this.reqInitData(BI.bind(this.__loaded, this)); + var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } } }, - render: function () { - return { - type: "bi.default" - }; - }, - - /** - * 子类用loadedRender代替原先的render方法 - */ - loadedRender: function () { - return { - type: "bi.default" - }; - }, - - reqInitData: function (callback) { - BI.isFunction(callback) && callback(); + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } }, __loaded: function () { + this.__asking = false; this.loaded(); - BI.createWidget(this.loadedRender(), { - element: this - }, this); + this._render(); } });/** * 有总页数和总行数的分页控件 diff --git a/dist/core.js b/dist/core.js index eca8223d8d..93055802e7 100644 --- a/dist/core.js +++ b/dist/core.js @@ -11771,6 +11771,10 @@ if (!_global.BI) { this._initElementHeight(); this._initVisual(); this._initState(); + this._initRender(); + }, + + _initRender: function () { if (this.beforeInit) { this.__asking = true; this.beforeInit(BI.bind(this._render, this)); diff --git a/dist/demo.js b/dist/demo.js index da5cc301ea..2849c470ad 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -3509,7 +3509,7 @@ Demo.COMPONENT_CONFIG = [{ }, - loadedRender: function () { + render: function () { return { type: "bi.center_adapt", items: [{ @@ -3519,7 +3519,7 @@ Demo.COMPONENT_CONFIG = [{ }; }, - reqInitData: function (callback) { + beforeInit: function (callback) { setTimeout(function () { callback(); }, 3000); diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 4e84af9082..9c81c0af31 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -12016,6 +12016,10 @@ if (!_global.BI) { this._initElementHeight(); this._initVisual(); this._initState(); + this._initRender(); + }, + + _initRender: function () { if (this.beforeInit) { this.__asking = true; this.beforeInit(BI.bind(this._render, this)); @@ -57425,37 +57429,28 @@ BI.shortcut("bi.sort_list", BI.SortList); BI.LoadingPane = BI.inherit(BI.Pane, { _mount: function () { - BI.Pane.superclass._mount.apply(this, arguments); - if (this.isMounted()) { - this.loading(); - this.reqInitData(BI.bind(this.__loaded, this)); + var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } } }, - render: function () { - return { - type: "bi.default" - }; - }, - - /** - * 子类用loadedRender代替原先的render方法 - */ - loadedRender: function () { - return { - type: "bi.default" - }; - }, - - reqInitData: function (callback) { - BI.isFunction(callback) && callback(); + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } }, __loaded: function () { + this.__asking = false; this.loaded(); - BI.createWidget(this.loadedRender(), { - element: this - }, this); + this._render(); } });/** * 有总页数和总行数的分页控件 diff --git a/dist/fineui.js b/dist/fineui.js index f2a14c03ad..519d8b0f58 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -12016,6 +12016,10 @@ if (!_global.BI) { this._initElementHeight(); this._initVisual(); this._initState(); + this._initRender(); + }, + + _initRender: function () { if (this.beforeInit) { this.__asking = true; this.beforeInit(BI.bind(this._render, this)); @@ -57829,37 +57833,28 @@ BI.shortcut("bi.sort_list", BI.SortList); BI.LoadingPane = BI.inherit(BI.Pane, { _mount: function () { - BI.Pane.superclass._mount.apply(this, arguments); - if (this.isMounted()) { - this.loading(); - this.reqInitData(BI.bind(this.__loaded, this)); + var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } } }, - render: function () { - return { - type: "bi.default" - }; - }, - - /** - * 子类用loadedRender代替原先的render方法 - */ - loadedRender: function () { - return { - type: "bi.default" - }; - }, - - reqInitData: function (callback) { - BI.isFunction(callback) && callback(); + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } }, __loaded: function () { + this.__asking = false; this.loaded(); - BI.createWidget(this.loadedRender(), { - element: this - }, this); + this._render(); } });/** * 有总页数和总行数的分页控件 diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index fde7675700..f7a243e0ef 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -11771,6 +11771,10 @@ if (!_global.BI) { this._initElementHeight(); this._initVisual(); this._initState(); + this._initRender(); + }, + + _initRender: function () { if (this.beforeInit) { this.__asking = true; this.beforeInit(BI.bind(this._render, this)); @@ -40842,37 +40846,28 @@ BI.shortcut("bi.sort_list", BI.SortList); BI.LoadingPane = BI.inherit(BI.Pane, { _mount: function () { - BI.Pane.superclass._mount.apply(this, arguments); - if (this.isMounted()) { - this.loading(); - this.reqInitData(BI.bind(this.__loaded, this)); + var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } } }, - render: function () { - return { - type: "bi.default" - }; - }, - - /** - * 子类用loadedRender代替原先的render方法 - */ - loadedRender: function () { - return { - type: "bi.default" - }; - }, - - reqInitData: function (callback) { - BI.isFunction(callback) && callback(); + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } }, __loaded: function () { + this.__asking = false; this.loaded(); - BI.createWidget(this.loadedRender(), { - element: this - }, this); + this._render(); } });/** * 有总页数和总行数的分页控件 diff --git a/src/case/loading/loading_pane.js b/src/case/loading/loading_pane.js index f8668763f4..0066c58fbc 100644 --- a/src/case/loading/loading_pane.js +++ b/src/case/loading/loading_pane.js @@ -8,36 +8,27 @@ BI.LoadingPane = BI.inherit(BI.Pane, { _mount: function () { - BI.Pane.superclass._mount.apply(this, arguments); - if (this.isMounted()) { - this.loading(); - this.reqInitData(BI.bind(this.__loaded, this)); + var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } } }, - render: function () { - return { - type: "bi.default" - }; - }, - - /** - * 子类用loadedRender代替原先的render方法 - */ - loadedRender: function () { - return { - type: "bi.default" - }; - }, - - reqInitData: function (callback) { - BI.isFunction(callback) && callback(); + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } }, __loaded: function () { + this.__asking = false; this.loaded(); - BI.createWidget(this.loadedRender(), { - element: this - }, this); + this._render(); } }); \ No newline at end of file diff --git a/src/core/widget.js b/src/core/widget.js index d84839f207..dbbda9eeb7 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -54,6 +54,10 @@ this._initElementHeight(); this._initVisual(); this._initState(); + this._initRender(); + }, + + _initRender: function () { if (this.beforeInit) { this.__asking = true; this.beforeInit(BI.bind(this._render, this));